本文整理汇总了C#中System.Windows.Controls.UserControl.FindResource方法的典型用法代码示例。如果您正苦于以下问题:C# UserControl.FindResource方法的具体用法?C# UserControl.FindResource怎么用?C# UserControl.FindResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.UserControl
的用法示例。
在下文中一共展示了UserControl.FindResource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: applyBehavior
override public void applyBehavior(UserControl control, string name, int value)
{
if (value == 0)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource(TRAFFIC_GREEN_LIGHT_XML_TAG);
}
else if (value == 1)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource(TRAFFIC_RED_LIGHT_XML_TAG);
}
else
{
setObjectHidden();
}
}
示例2: applyBehavior
override public void applyBehavior(UserControl control, string name, int value)
{
if ((value != 1 && value != 2))
{
_objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Good");
}
else if (value == 1)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Warning");
}
else if (value == 2)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Bad");
}
}
示例3: applyBehavior
override public void applyBehavior(UserControl control, string name, int value)
{
if (value == 1)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource("M_Error");
}
else if (value == 2)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource("M_Warning");
}
else
{
_objectGeometry.Material = (Material)control.FindResource("M_Interlock");
}
}
示例4: applyBehavior
override public void applyBehavior(UserControl control, string name, int value)
{
System.Console.WriteLine("Applying behavior to " + name + " value " + value);
if (value == 1)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource("M_Error");
}
else if (value == 2)
{
_objectGeometry.Material = (MaterialGroup)control.FindResource("M_Warning");
}
else
{
_objectGeometry.Material = (Material)control.FindResource("M_Interlock");
}
}
示例5: playAnimation
/// <summary>
/// Ga terug naar idle
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void playAnimation(String animation_name, UserControl uc) // Mogelijke animaties: idle, attack, winner
{
Storyboard sb = uc.FindResource(animation_name) as Storyboard;
sb.Completed += (sender, eventArgs) =>
{
Storyboard sb2 = uc.FindResource("idle") as Storyboard;
sb2.Begin();
RefreshData();
};
sb.Begin();
}