就是在按钮中可以加上 枚举的信息搜索
public static PageEnum GetPage(DependencyObject obj)
{
return (PageEnum)obj.GetValue(PageProperty);
}
public static void SetPage(DependencyObject obj, PageEnum value)
{
obj.SetValue(PageProperty, value);
}
// Using a DependencyProperty as the backing store for Page. This enables animation, styling, binding, etc...
public static readonly DependencyProperty PageProperty =
DependencyProperty.RegisterAttached("Page", typeof(PageEnum), typeof(PageHelper), new PropertyMetadata(PageEnum.None));
}
枚举
public enum PageEnum
{
None,
Home,
Account_Manage,
Account_InUse,
Account_Regist,
Account_UseLess,
DocManage,
OrderManage,
StoreManage,
TestManage,
Orders_Temp,
Orders_InUse
}
调用
xmlns:pagehelper="clr-namespace:命名空间"
<StackPanel FlowDirection="RightToLeft" HorizontalAlignment="Right" Height="41" Margin="347,20,0,0" VerticalAlignment="Top" Width="462" Orientation="Horizontal">
<!--<RadioButton Click="ChangePage_Click" Content="注册账户" pagehelper:PageHelper.Page="Account_Regist" Width="150" Height="40" Style="{StaticResource MenuRadioButtonStyle}" Margin="5,0.5,0,0.5"/>-->
<RadioButton Click="ChangePage_Click" Content="异常账户" pagehelper:PageHelper.Page="Account_UseLess" Width="150" Height="40" Style="{StaticResource MenuRadioButtonStyle}" Margin="5,0,0,0"/>
<RadioButton Click="ChangePage_Click" Content="正常账户" pagehelper:PageHelper.Page="Account_InUse" IsChecked="True" Width="150" Height="40" Style="{StaticResource MenuRadioButtonStyle}" Margin="5,0,0,0"/>
</StackPanel>