Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working with XAML and I was wondering if someone can give me a little exmpl

ID: 3823929 • Letter: I

Question

I am working with XAML and I was wondering if someone can give me a little exmple of implementing the following styles to the following XAML.

Implement a custom style for each type of control on your window.

Use at least one inherited style.

Use at least one default style.

Use at least one implicit style.

XAML:

<Window x:Class="Assignment4._2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="900" Width="800
">
<Window.Resources>
<XmlDataProvider x:Name = "XDP" x:Key="XDP" Source="Dialogfile.xml" XPath="Dialog" />
</Window.Resources>
<Grid DataContext="{StaticResource XDP}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="140" />
<ColumnDefinition Width="119"/>
<ColumnDefinition Width="140" />
<ColumnDefinition Width="101"/>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="140" />
<ColumnDefinition Width="119"/>
<ColumnDefinition Width="140" />
  

  

</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="65"/>
<RowDefinition Height="Auto" MinHeight="65"/>
<RowDefinition Height="60" MinHeight="20"/>
<RowDefinition Height="Auto" MinHeight="65"/>
<RowDefinition Height="Auto" MinHeight="65"/>
<RowDefinition Height="Auto" MinHeight="62"/>
<RowDefinition Height="Auto" MinHeight="68"/>
<RowDefinition Height="Auto" MinHeight="150"/>
<RowDefinition Height="Auto" MinHeight="150"/>
<RowDefinition Height="Auto" MinHeight="50"/>

  
</Grid.RowDefinitions>
<Label x:Name="labelTarget" Content="TargetNPC" HorizontalAlignment="Center" Margin="38,0,20,0" Width="72" FontWeight="Bold" />
<Label x:Name="labelCameraType" Content="Camera Type" Grid.Row="1" HorizontalAlignment="Center" Margin="28,25,22,24" Width="80" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" Padding="-2,5,5,5" Height="16"/>
  
<Label x:Name="labelID1" Content="ID:" Grid.Row="3" HorizontalAlignment="Center" Margin="30,0" Width="70" FontWeight="Bold" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label x:Name="labelType" Content="Type" Grid.Row="5" HorizontalAlignment="Center" Margin="16,0,28,0" Width="86" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
<Label x:Name="labelNode1" Content="Node 1:&#xD;&#xA;" Grid.Row="2" HorizontalAlignment="Left" Margin="8,12,0,11" Width="102" FontWeight="Bold" VerticalAlignment="Center" Height="42"/>
<Label x:Name="labelSpeechType" Content="Speech Type:" Grid.Row="6" HorizontalAlignment="Center" Margin="18,0,30,0" Width="82" FontWeight="Bold" VerticalContentAlignment="Center"/>
<Label x:Name="labelResponses" Content="Responses:" Grid.Row="7" HorizontalAlignment="Center" Margin="18,0,30,0" Width="82" FontWeight="Bold" VerticalContentAlignment="Center"/>
<Label x:Name="labelNode1Question" Content="Text:" Grid.Row="4" HorizontalAlignment="Center" Margin="18,0,30,0" Width="82" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
<Label x:Name="labelNextNode" Content="Next Node:" Grid.Row="8" HorizontalAlignment="Center" Margin="18,0,30,0" Width="82" FontWeight="Bold" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
<Label x:Name="labelInteraction" Content="Interaction" Grid.Column="2" Grid.Row="5" HorizontalAlignment="Center" Margin="10,0" Width="99" FontWeight="Bold" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Padding="5,5,-10,5"/>
<Label x:Name="labelQuest" Content="Quest" Grid.Column="2" Grid.Row="6" HorizontalAlignment="Center" Margin="10,0" Width="99" FontWeight="Bold" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Padding="5,5,-10,5"/>
<Label x:Name="labelStep" Content="Step" Grid.Column="2" Grid.Row="7" Margin="10,0" Width="99" FontWeight="Bold" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Padding="5,5,-10,5" VerticalAlignment="Top" Height="76"/>
  
<TextBox x:Name="textBoxNPC" Text="{Binding XPath= TargetNPC}" Grid.Column="1" Margin="0,18,0,17" TextChanged="textBoxNPC_TextChanged"/>
<ComboBox x:Name="comboboxCamera" Text="{Binding XPath= CameraType}" Grid.Column="1" Grid.Row="1" Margin="0,17,0,18"/>
  
<TextBox x:Name="texBoxID" Text="{Binding XPath= Nodes/Node/ID}" Grid.Column="1" Grid.Row="3" Margin="0,17,0,18" TextChanged="texBoxID_TextChanged"/>
<TextBox x:Name="textBoxResponse3" Text="{Binding XPath= Nodes/Node/Responses/Response[3]/Text}" Grid.Column="1" Grid.Row="7" Margin="0,20" RenderTransformOrigin="0.5,0.5" Height="30">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="35"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<TextBox x:Name="textBoxResponse1" Text="{Binding XPath= Nodes/Node/Responses/Response[1]/Text}" Grid.Column="1" Grid.Row="7" RenderTransformOrigin="0.5,0.5" Margin="0,20" Height="30">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="-38"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<TextBox x:Name="textBoxResponse2" Text="{Binding XPath= Nodes/Node/Responses/Response[2]/Text}" Grid.Column="1" Grid.Row="7" RenderTransformOrigin="0.5,0.5" Margin="0,20" Height="30">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="-2"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<TextBox x:Name="textBoxText" Text="{Binding XPath= Nodes/Node/Text}" Grid.Column="1" Grid.Row="4" Margin="0,18,36,17" Grid.ColumnSpan="2"/>
<ComboBox x:Name="comboBoxType" Text="{Binding XPath= Nodes/Node/Type}" Grid.Column="1" Grid.Row="5" Margin="0,16"/>
<ComboBox x:Name="comboBoxSpeechType" Text="{Binding XPath= Nodes/Node/SpeechType}" Grid.Column="1" Grid.Row="6" Margin="0,19"/>
<TextBox x:Name="textBoxNN1" Text="{Binding XPath= Nodes/Node/Responses/Response[1]/NextNode}" Grid.Column="1" Grid.Row="8" Margin="0,18" RenderTransformOrigin="0.5,0.5" Height="30">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="-20"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<TextBox x:Name="textBoxNN2" Text="{Binding XPath= Nodes/Node/Responses/Response[2]/NextNode}" Grid.Column="1" Grid.Row="8" Margin="0,18" RenderTransformOrigin="0.5,0.5" Height="30">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="15"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<TextBox x:Name="textBoxNN3" Text="{Binding XPath= Nodes/Node/Responses/Response[2]/Text}" Grid.Column="1" Grid.Row="8" Margin="0,18" RenderTransformOrigin="0.5,0.5" Height="30">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="50"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<ComboBox x:Name="comboBoxInteraction" Grid.Column="3" Grid.Row="5" Margin="0,16"/>
<TextBox x:Name="textBoxQuest" Grid.Column="3" Grid.Row="6" Margin="0,19"/>
<TextBox x:Name="textBoxStep" Grid.Column="3" Grid.Row="7" Margin="0,19,0,98"/>

</Grid>
</Window>














  

  










  



  










  


  
































































Explanation / Answer

Style x:Key="BasicStyle" TargetType="ContentControl">
<Setter Property="Width" Value="130" />
<Setter Property="Height" Value="30" />
</Style>

<Style x:Key="ButtonStyle" TargetType="Button"
BasedOn="{StaticResource BasicStyle}">
<Setter Property="BorderBrush" Value="Orange" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="Foreground" Value="Red" />
</Style>

<Style x:Key="CheckBoxStyle" TargetType="CheckBox"
BasedOn="{StaticResource BasicStyle}">
<Setter Property="BorderBrush" Value="Blue" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="Foreground" Value="Green" />
</Style>
</Page.Resources>

<StackPanel>
<Button Content="Button" Margin="0,10"/>
<CheckBox Content="CheckBox"/>
</StackPanel>

Page.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="ButtonBackground" Color="Transparent"/>
<SolidColorBrush x:Key="ButtonForeground" Color="MediumSlateBlue"/>
<SolidColorBrush x:Key="ButtonBorderBrush" Color="MediumSlateBlue"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Page.Resources>

<CheckBox Content="Normal CheckBox" Margin="5"/>
<CheckBox Content="Special CheckBox" Margin="5">
<CheckBox.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="CheckBoxForegroundUnchecked"
Color="Purple"/>
<SolidColorBrush x:Key="CheckBoxForegroundChecked"
Color="Purple"/>
<SolidColorBrush x:Key="CheckBoxCheckGlyphForegroundChecked"
Color="White"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundStrokeChecked"
Color="Purple"/>
<SolidColorBrush x:Key="CheckBoxCheckBackgroundFillChecked"
Color="Purple"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</CheckBox.Resources>
</CheckBox>
<CheckBox Content="Normal CheckBox" Margin="5"/>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote