Do everything via XAML

Hi guys,

I am wondering If I can create a window and add all the elements I need via XAML syntax. I just feel that I have more control over creating the UI that way, so I would love to go from this

To this:

<Window x:Class=""
       
        Title="Volumes from Areas" MinHeight="240.00"  MinWidth="20.90" MaxHeight="500.00" MaxWidth="900.90"  Height="300.00" Width="250.9" SourceInitialized="Window_SourceInitialized"  
        WindowStartupLocation="CenterScreen" Foreground="Black" Background="#FF303030" Visibility="Visible" BorderThickness="0" BorderBrush="#FF212121" WindowStyle="ToolWindow"  >
    
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo/>
    </Window.TaskbarItemInfo>

    <Grid Background="#FF324353">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
           
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="*"/>

        </Grid.ColumnDefinitions>



        <Button Content="Exit" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Center" Width="83" Height="28" 
                FontSize="15" Click="Exit_click" Grid.Row="4" Grid.Column="1"  Background="#FF5491A3" BorderBrush="#FF00D1FF" Foreground="White" />



        <Button Content="Generate volumes" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Center" Width="152" Height="28" FontSize="15"
            Command ="{Binding GenerateVolumesCommand, Mode=Oneway}" 
                Grid.Row="0" Background="#FF5491A3" BorderBrush="#FF00D1FF" Foreground="White"/>


        <Button Content="Delete volumes" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Center" Width="152" Height="28" FontSize="15"
            Command ="{Binding DeleteVolumesCommand, Mode=Oneway}" 
                Grid.Row="3" Grid.Column="0" Background="#FF5491A3" BorderBrush="#FF00D1FF" Foreground="White"/>


        <Button Content="Create 3D view" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Center" Width="152" Height="28" FontSize="15"
            Command ="{Binding Create3DViewCommand, Mode=Oneway}" 
                Grid.Row="1" Background="#FF5491A3" BorderBrush="#FF00D1FF" Foreground="White"/>
        

        <Button Content="Show volumes only" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Center" Width="152" Height="28" FontSize="15"
            Command ="{Binding HideAllElementsInViewCommand, Mode=Oneway}" 
                Grid.Row="2" Background="#FF5491A3" BorderBrush="#FF00D1FF" Foreground="White"/>










    </Grid>


</Window>


Let me know if this is possible and the workflow to input a file containing the XAML

Thank you,

Nicholas

XAML input is only possible for things that you don’t need to be interactive. Normal Human UI components wrap the normal elements (Button, Slider, etc) with additional functionality that allows them to play nicely with the value listener, add to window, and property modification components. There is also no automatic way I know of to go from an already-constructed window to a XAML representation.

Thanks for the reply Andrew

Ok, I though that with a XAML build up I could still take advantage of your cool value listener component, without specifing data binding in the given XAML file.