P
pianoboyCoder
Guest
Here is my xaml below. The DisplayUnitConverter is not firing when I click the radio buttons.Can someone assist me to see what I am doing wrong?
<Window x:Class="DisplayUnitClient.MainWindow"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlnsisplayUnitClient ="clr-namespaceisplayUnitClient"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<DisplayUnitClientisplayUnitConverter x:Key="DisplayUnitConverter" />
</Window.Resources>
<Grid>
<dxe:SpinEdit x:Name="spinEditMaxHatchSpeed" Height="{Binding ActualHeight, ElementName=label}" AllowDefaultButton="False" Value="{Binding MaxHatchSpeed, ElementName=groupBoxDisplaySettings, Converter={StaticResource DisplayUnitConverter}, Mode=TwoWay}" Margin="0,0,0,285">
<dxe:ButtonInfo IsLeft="True" Content="<" Command="{Binding SpinDownCommand, RelativeSource={RelativeSource AncestorType={x:Type dxe:SpinEdit}, Mode=FindAncestor}}"/>
<dxe:ButtonInfo Content=">" Command="{Binding SpinUpCommand, RelativeSource={RelativeSource AncestorType={x:Type dxe:SpinEdit}, Mode=FindAncestor}}"/>
</dxe:SpinEdit>
<GroupBox x:Name="groupBoxDisplaySettings" Header="Display Units" HorizontalAlignment="Stretch" VerticalAlignment="Top" FontSize="16" Margin="0,39,10,0">
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Vertical" Width="349" >
<Label Content="Max Hatch Speed:" />
<RadioButton Margin="0,0,20,0" Content="Millimeters" Name="MillimeterDisplayUnitButton" GroupName="DisplayUnits" Click="DisplayUnitMode_Clicked" Tag="0"/>
<RadioButton Content="Inches" Name="InchesDisplayUnitButton" GroupName="DisplayUnits" Click="DisplayUnitMode_Clicked" Tag="1" />
</StackPanel>
</GroupBox>
</Grid>
</Window>
pianoboyCoder
Continue reading...
<Window x:Class="DisplayUnitClient.MainWindow"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlnsisplayUnitClient ="clr-namespaceisplayUnitClient"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<DisplayUnitClientisplayUnitConverter x:Key="DisplayUnitConverter" />
</Window.Resources>
<Grid>
<dxe:SpinEdit x:Name="spinEditMaxHatchSpeed" Height="{Binding ActualHeight, ElementName=label}" AllowDefaultButton="False" Value="{Binding MaxHatchSpeed, ElementName=groupBoxDisplaySettings, Converter={StaticResource DisplayUnitConverter}, Mode=TwoWay}" Margin="0,0,0,285">
<dxe:ButtonInfo IsLeft="True" Content="<" Command="{Binding SpinDownCommand, RelativeSource={RelativeSource AncestorType={x:Type dxe:SpinEdit}, Mode=FindAncestor}}"/>
<dxe:ButtonInfo Content=">" Command="{Binding SpinUpCommand, RelativeSource={RelativeSource AncestorType={x:Type dxe:SpinEdit}, Mode=FindAncestor}}"/>
</dxe:SpinEdit>
<GroupBox x:Name="groupBoxDisplaySettings" Header="Display Units" HorizontalAlignment="Stretch" VerticalAlignment="Top" FontSize="16" Margin="0,39,10,0">
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Vertical" Width="349" >
<Label Content="Max Hatch Speed:" />
<RadioButton Margin="0,0,20,0" Content="Millimeters" Name="MillimeterDisplayUnitButton" GroupName="DisplayUnits" Click="DisplayUnitMode_Clicked" Tag="0"/>
<RadioButton Content="Inches" Name="InchesDisplayUnitButton" GroupName="DisplayUnits" Click="DisplayUnitMode_Clicked" Tag="1" />
</StackPanel>
</GroupBox>
</Grid>
</Window>
pianoboyCoder
Continue reading...