Configure binding arguments.
More...
Configure binding arguments.
- See also
- BindingHost
Gets or sets the binding expression.
Examples
To set the binding expression of a binding:
public void Execute(PluginCommandParameter parameter)
{
var rootPage = studio.ActiveProject.GetProjectItem("Screens/Screen/RootPage");
var textBlock = studio.ActiveProject.CreateProjectItem<TextBlock2D>(rootPage.GenerateUniqueChildName("Text Block 2D"), rootPage);
var binding = textBlock.CreateBinding(Properties.Node2DLayoutTransformation, AnimationTargetPropertyAttributeEnum.SCALE_X, "10");
binding.Code = "{@./LayoutTransformation}.TranslationY";
}
Checks whether the binding expression is valid.
Examples
To check whether a binding expression is valid:
public void Execute(PluginCommandParameter parameter)
{
var rootPage = studio.ActiveProject.GetProjectItem("Screens/Screen/RootPage");
var textBlock = studio.ActiveProject.CreateProjectItem<TextBlock2D>(rootPage.GenerateUniqueChildName("Text Block 2D"), rootPage);
var binding = textBlock.CreateBinding(
Properties.Node2DLayoutTransformation, AnimationTargetPropertyAttributeEnum.SCALE_X, "@./LayoutTransformation}.TranslationY");
if (!binding.IsCodeValid)
{
studio.Log("Invalid binding expression " + binding.Code + " in the " + textBlock.Name + " node");
}
}
Gets the property the binding binds.
Examples
To get the property a binding binds:
public void Execute(PluginCommandParameter parameter)
{
var rootPage = studio.ActiveProject.GetProjectItem("Screens/Screen/RootPage");
var textBlock = studio.ActiveProject.CreateProjectItem<TextBlock2D>(rootPage.GenerateUniqueChildName("Text Block 2D"), rootPage);
var binding = textBlock.CreateBinding(Properties.Node2DLayoutTransformation, AnimationTargetPropertyAttributeEnum.SCALE_X, "10");
studio.Log("Binding Property: " + binding.Property.Name);
}
AnimationTargetPropertyAttributeEnum PropertyAttribute |
|
getset |
Gets or sets the property attribute the binding binds.
Examples
To set the property attribute a binding binds:
public void Execute(PluginCommandParameter parameter)
{
var rootPage = studio.ActiveProject.GetProjectItem("Screens/Screen/RootPage");
var textBlock = studio.ActiveProject.CreateProjectItem<TextBlock2D>(rootPage.GenerateUniqueChildName("Text Block 2D"), rootPage);
var binding = textBlock.CreateBinding(Properties.Node2DLayoutTransformation, AnimationTargetPropertyAttributeEnum.SCALE_X, "10");
binding.PropertyAttribute = AnimationTargetPropertyAttributeEnum.SCALE_Y;
}