home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Binding Properties not updating
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="morpheus_xx" data-source="post: 1031225" data-attributes="member: 48495"><p>The cause is simple, I had to learn this difference to WPF myself:</p><p>In MPF you also need to expose the AbstractProperty for xaml binding.</p><p></p><p>If your property is named "Width" you have to expose "public AbstractProperty WidthProperty".</p><p></p><p>Another important note: from models use only WProperty (weak references). SProperty is only allowed for controls.</p><p></p><p>For an example and comments take look at the HelloWorldModel:</p><p>[CODE=csharp] /// <summary></p><p> /// This sample property will be accessed by the hello_world screen. Note that the data type must be the same</p><p> /// as given in the instantiation of our backing property <see cref="_helloStringProperty"/>.</p><p> /// </summary></p><p> public string HelloString</p><p> {</p><p> get { return (string) _helloStringProperty.GetValue(); }</p><p> set { _helloStringProperty.SetValue(value); }</p><p> }</p><p></p><p> /// <summary></p><p> /// This is the dependency property for our sample string. It is needed to propagate changes to the skin.</p><p> /// </summary></p><p> /// <remarks></p><p> /// <para></p><p> /// If the screen databinds to the <see cref="HelloString"/> property in a binding mode which will propagate data</p><p> /// changes from the model to the skin (OneWay, TwoWay), the SkinEngine will attach a change handler to this property</p><p> /// and react to changes.</p><p> /// </para></p><p> /// <para></p><p> /// In other words: For each property <c>Xyz</c>, which should be able to be attached to, there must be an</p><p> /// <see cref="AbstractProperty"/> with name <c>XyzProperty</c>.</p><p> /// Only if <c>XyzProperty</c> is present in the model, value changes can be propagated to the skin.</p><p> /// </para></p><p> /// </remarks></p><p> public AbstractProperty HelloStringProperty</p><p> {</p><p> get { return _helloStringProperty; }</p><p> }</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="morpheus_xx, post: 1031225, member: 48495"] The cause is simple, I had to learn this difference to WPF myself: In MPF you also need to expose the AbstractProperty for xaml binding. If your property is named "Width" you have to expose "public AbstractProperty WidthProperty". Another important note: from models use only WProperty (weak references). SProperty is only allowed for controls. For an example and comments take look at the HelloWorldModel: [CODE=csharp] /// <summary> /// This sample property will be accessed by the hello_world screen. Note that the data type must be the same /// as given in the instantiation of our backing property <see cref="_helloStringProperty"/>. /// </summary> public string HelloString { get { return (string) _helloStringProperty.GetValue(); } set { _helloStringProperty.SetValue(value); } } /// <summary> /// This is the dependency property for our sample string. It is needed to propagate changes to the skin. /// </summary> /// <remarks> /// <para> /// If the screen databinds to the <see cref="HelloString"/> property in a binding mode which will propagate data /// changes from the model to the skin (OneWay, TwoWay), the SkinEngine will attach a change handler to this property /// and react to changes. /// </para> /// <para> /// In other words: For each property <c>Xyz</c>, which should be able to be attached to, there must be an /// <see cref="AbstractProperty"/> with name <c>XyzProperty</c>. /// Only if <c>XyzProperty</c> is present in the model, value changes can be propagated to the skin. /// </para> /// </remarks> public AbstractProperty HelloStringProperty { get { return _helloStringProperty; } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Binding Properties not updating
Contact us
RSS
Top
Bottom