本文整理汇总了C#中System.Windows.Controls.Primitives.ToggleButton.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ToggleButton.ToString方法的具体用法?C# ToggleButton.ToString怎么用?C# ToggleButton.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Primitives.ToggleButton
的用法示例。
在下文中一共展示了ToggleButton.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToStringTest
public void ToStringTest ()
{
ToggleButton button = new ToggleButton ();
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#A1");
button.IsChecked = true;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:True", button.ToString (), "#A2");
button.IsChecked = null;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:null", button.ToString (), "#A3");
button.IsChecked = false;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#A4");
button.IsThreeState = false;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#B1");
button.IsChecked = true;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:True", button.ToString (), "#B2");
button.IsChecked = null;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:null", button.ToString (), "#B3");
button.IsChecked = false;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#B4");
button.IsThreeState = true;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#C1");
button.IsChecked = true;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:True", button.ToString (), "#C2");
button.IsChecked = null;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:null", button.ToString (), "#C3");
button.IsChecked = false;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#C4");
button.Content = "Hello";
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content:Hello IsChecked:False", button.ToString (), "#D1");
button.IsChecked = true;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content:Hello IsChecked:True", button.ToString (), "#D2");
button.IsChecked = null;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content:Hello IsChecked:null", button.ToString (), "#D3");
button.IsChecked = false;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content:Hello IsChecked:False", button.ToString (), "#D4");
button.Content = null;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#E1");
button.IsChecked = true;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:True", button.ToString (), "#E2");
button.IsChecked = null;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:null", button.ToString (), "#E3");
button.IsChecked = false;
Assert.AreEqual ("System.Windows.Controls.Primitives.ToggleButton Content: IsChecked:False", button.ToString (), "#E4");
}