Attached Property Changed Handler
Posted: 06 Feb 2016, 05:23
Hello,
1.- I have a custom-control in WPF where I can subscribe to the change notification of an attached property with this:
But I couldn't find something similar, is there a way to do this with Noesis?
2.-While trying to use FocusManager.IsFocusScope in a xaml file, the resource build tool does not recognize it,
is there a namespace I need to add?
3.- I'm creating an user control is the OnPostInit method a good place to find some controls?
also do I need to unsubscribe?, I'm asking this because of the trello https://trello.com/c/k7pREwVK/29-435-ci ... t-handlers
and if so, what would be the best overriding member method to do it ?
4.- this xaml is not setting the canvas left and top is not working
this is the type of SourcePoint
do you know why?
5.- Where can I see the binding errors ?
6.- how can I freeze a resource with noesis (I was told that is better to freeze the brushes for performance), in wpf I used to do this
7.- it seems that
is not working in controls
Thanks!.
1.- I have a custom-control in WPF where I can subscribe to the change notification of an attached property with this:
Code: Select all
DependencyPropertyDescriptor.FromProperty(Canvas.LeftProperty, typeof (MyCustomControl)).AddValueChanged(Mydelegate);
2.-While trying to use FocusManager.IsFocusScope in a xaml file, the resource build tool does not recognize it,
is there a namespace I need to add?
3.- I'm creating an user control is the OnPostInit method a good place to find some controls?
Code: Select all
void DiagramEditor::OnPostInit()
{
ParentClass::OnPostInit();
m_canvas = FindName<Canvas>("TheCanvas");
m_canvas->PreviewMouseWheel() += MakeDelegate(this,&DiagramEditor::OnEditorZoom);
}
and if so, what would be the best overriding member method to do it ?
4.- this xaml is not setting the canvas left and top is not working
Code: Select all
<Ellipse Fill="{StaticResource ConnectorColorBrush}" Height="10" Width="10" Name="Circle"
Canvas.Left="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SourcePoint.X}"
Canvas.Top="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SourcePoint.Y}">Code: Select all
struct Point : Drawing::Point
{
NS_IMPLEMENT_INLINE_REFLECTION(Point, Drawing::Point)
{
NsMeta<Core::TypeId>("Editor.Point");
NsProp("X", &Point::GetX, &Point::SetX);
NsProp("Y", &Point::GetY, &Point::SetY);
}
}5.- Where can I see the binding errors ?
6.- how can I freeze a resource with noesis (I was told that is better to freeze the brushes for performance), in wpf I used to do this
Code: Select all
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:editor="clr-namespace:Editor">
<SolidColorBrush x:Key="ConnectorColorBrush" Color="#888" po:Freeze="True" />Code: Select all
void OnPreviewMouseDoubleClick(const Gui::MouseButtonEventArgs& e) override;Thanks!.