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
Problem with updating binding properties
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="d2Liks" data-source="post: 847542" data-attributes="member: 119567"><p>Hod should i organize data refreshing to make xaml data change?</p><p>Could you tell me if MediaPortal2 supports MVVM?</p><p> </p><p>Plugin:</p><p><Plugin</p><p>DescriptorVersion="1.0"</p><p>Name="Plugins"</p><p>PluginId="C28ABD6B-9615-4512-B8DA-A04096F35628"</p><p>Author="d2L"</p><p>Copyright="d2L"</p><p>Description="Sample plugin"</p><p>PluginVersion="0.1"></p><p> </p><p><Runtime></p><p><Assembly FileName="Plugins.dll"/></p><p></Runtime></p><p> </p><p><Register Location="/Models"></p><p><Model Id="5726DA5A-70D5-458f-AF67-611293D97912" Name="ViewModel" ClassName="Plugins.Models.PluginModel"/></p><p></Register></p><p> </p><p><Register Location="/Resources/Skin"></p><p><Resource Id="PluginsSkin" Directory="Skin" Type="Skin"/></p><p></Register></p><p> </p><p><Register Location="/Resources/Language"></p><p><Resource Id="PluginsLanguage" Directory="Language" Type="Language"/></p><p></Register></p><p></Plugin></p><p> </p><p>cs:</p><p>private AbstractProperty _country;</p><p></p><p>public AbstractProperty CountryProperty</p><p>{</p><p>get { return _country; }</p><p>}</p><p>public string Country</p><p>{</p><p>get { return (string)_country.GetValue(); }</p><p>set { _country.SetValue(value); }</p><p>}</p><p></p><p>public PluginModel()</p><p>{ </p><p> _country = new WProperty(typeof(string), null); </p><p>}</p><p></p><p>//There should be refresh after pressing on a button, but nothing happens</p><p>public void SendMessage()</p><p>{</p><p>Country="Message";</p><p>} </p><p> </p><p> </p><p>xaml:</p><p><!-- Contents --></p><p><ControlTemplate x:Key="Contents_Template" ></p><p><DockPanel Context="{Model Id=5726DA5A-70D5-458f-AF67-611293D97912}" LastChildFill="False"></p><p> </p><p> </p><p><DockPanel.Resources></p><p><Model x:Key="ViewModel" Id="5726DA5A-70D5-458f-AF67-611293D97912"/></p><p></DockPanel.Resources></p><p><Button Style="{ThemeResource ButtonWideStyle}" Width="90" Margin="5,0,0,0" Command="{Command SendMessage}"></Button></p><p><Label Content="{Binding Path=Country, Mode=TwoWay}" /></p><p> </p><p></DockPanel></p><p></ControlTemplate></p></blockquote><p></p>
[QUOTE="d2Liks, post: 847542, member: 119567"] Hod should i organize data refreshing to make xaml data change? Could you tell me if MediaPortal2 supports MVVM? Plugin: <Plugin DescriptorVersion="1.0" Name="Plugins" PluginId="C28ABD6B-9615-4512-B8DA-A04096F35628" Author="d2L" Copyright="d2L" Description="Sample plugin" PluginVersion="0.1"> <Runtime> <Assembly FileName="Plugins.dll"/> </Runtime> <Register Location="/Models"> <Model Id="5726DA5A-70D5-458f-AF67-611293D97912" Name="ViewModel" ClassName="Plugins.Models.PluginModel"/> </Register> <Register Location="/Resources/Skin"> <Resource Id="PluginsSkin" Directory="Skin" Type="Skin"/> </Register> <Register Location="/Resources/Language"> <Resource Id="PluginsLanguage" Directory="Language" Type="Language"/> </Register> </Plugin> cs: private AbstractProperty _country; public AbstractProperty CountryProperty { get { return _country; } } public string Country { get { return (string)_country.GetValue(); } set { _country.SetValue(value); } } public PluginModel() { _country = new WProperty(typeof(string), null); } //There should be refresh after pressing on a button, but nothing happens public void SendMessage() { Country="Message"; } xaml: <!-- Contents --> <ControlTemplate x:Key="Contents_Template" > <DockPanel Context="{Model Id=5726DA5A-70D5-458f-AF67-611293D97912}" LastChildFill="False"> <DockPanel.Resources> <Model x:Key="ViewModel" Id="5726DA5A-70D5-458f-AF67-611293D97912"/> </DockPanel.Resources> <Button Style="{ThemeResource ButtonWideStyle}" Width="90" Margin="5,0,0,0" Command="{Command SendMessage}"></Button> <Label Content="{Binding Path=Country, Mode=TwoWay}" /> </DockPanel> </ControlTemplate> [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Problem with updating binding properties
Contact us
RSS
Top
Bottom