Avatar of Alyanto
Alyanto
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

MVVM Stack Panel, Custom Control

I have a  composite control that I would like to add into a stack panel using a viewModel Class as a data source

<UserControl x:Class="Control.DataViewGrid.View.ucField"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="40" d:DesignWidth="500">
    <Grid>
        <Border Height="31" Width="180" BorderThickness="3" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="LightGray"  Margin="10,5,0,0" CornerRadius="2,2,2,2">
            <Label Margin="2,-3,-3,-2" Content="Ctrl" x:Name="FieldName" />
        </Border>
        <Border Height="31" Width="100" BorderThickness="3" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="LightGray"  Margin="195,5,0,0" CornerRadius="2,2,2,2">
            <Label Margin="2,-3,-3,-2" Content="NVarchar (8000)" x:Name="DataType" />
        </Border>
        <Border Height="31" Width="170" BorderThickness="3" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="LightGray"  Margin="300,5,0,0" CornerRadius="2,2,2,2">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="147">
                <Label Margin="2,-3,40,-2" HorizontalContentAlignment="Right" Content="Is the field visible?" x:Name="IsVisible" Width="149" />
            </StackPanel>
        </Border>
        <CheckBox Margin="475,14,0,10" HorizontalAlignment="Left"></CheckBox>
    </Grid>
</UserControl>

Open in new window


How would I go about doing this?
C#Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
Paweł

8/22/2022 - Mon