复选框选择应确保结构值可以动态选择.

问题描述:

大家好,

在我的WPF应用程序中,基于选择
,我有一个复选框(打印)

Hi All,

In my WPF Application, I have a Check box(print), based on the selection

public struct _PrintState{
         public byte my_current_value;
          public byte my_previous_value;
....
...
}



//MyOtherFile.xaml.cs



//MyOtherFile.xaml.cs

_PrintState PRINTSTATE;

public void Print_Func()
{
PRINTSTATE  my_current_value = 0;// value should be 1 if PrintChk is selected.
PRINTSTATE  my_previous_valuee = 0;
....
}


根据Print.Xaml的选择,对于Checkbox(即PrintChk),则仅my_current_value = 1的值;如果没有其他说明.

在此先感谢.

问候,
Samanth_90


Based on Selection of Print.Xaml , for Checkbox, viz., PrintChk then only the value of my_current_value =1; if not otherwise.

Thanks in Advance.

With Regards,
Samanth_90

我是WPF的新手,但是我认为您可以将复选框绑定到基础值.奇怪的是,我在阅读 Sacha [ WPF:初学者指南-n的第5部分 [
I am very much a newcomer to WPF, but I think you can bind your checkbox to the underlying value. Strangely enough I was reading Sacha[^]''s WPF: A Beginner''s Guide - Part 5 of n[^] which covers Databinding, only yesterday.