Friday, 15 June 2012

c# - Derive XAML UserControl -


I'm new to WPF and I have a question:

In my projects I usually Many Usercontrols, which come from my 'Base' user control, which have some functions for all my user controls

With WPF (the etymology is the same is vanofha) is it possible to get XAM also?

Is this possible?

Thank you in advance

If you If you want to share resources in your user control, keep them in a style to target your user control base type. To access (and apply) these resources in the entire application, they are defined in App.xaml.

You can either define them in your base type:

  & lt; Style TargetType = {x: Type YourBaseType} & gt; & Lt; Style.Resources & gt; & Lt ;! - Define your resources here - & gt; & Lt; /Style.Resources> & Lt; / Style & gt; Or, you can apply them to all user controls (perhaps non-consultant):  
  style target type = {x: type: user control ] & Gt; & Lt; Style.Resources & gt; & Lt ;! - Define your resources here - & gt; & Lt; /Style.Resources> & Lt; / Style & gt;   

If you want to achieve visual aspects, then use the app, applying the settings in App.config definition. Take a look at , if necessary, this can be "unveiled" by a specific example.

No comments:

Post a Comment