c# - How to define XAML sample data for [] properties -


I am trying to use XALL sample data where my 'item' class property property is defined by dynamic properties This ( PremiseObject ) uses a form for [] does this:

  ... /// & lt ; Summary & gt; /// Property Accelerator imitates a dynamic object /// & lt; / Summary & gt; /// & lt; Param name = "name" & gt; & Lt; / Param & gt; /// & lt; Returns & gt; & Lt; / Returns & gt; Get this public [string name] {premiseProperty prop; If (_properties.triget value (name, outprop)) return prop value; // in XAM & lt; Button content = "trigger" command = "{binding [trigger comand]}" & gt; // where 'trigger' is the name of HT property which is transient (if name is. Context ("command")) {string cmd = name.Substring (0, name.Length - "command" .lambic); If (_properties.triget value (cmd, outpring)) {return new premier commm (this, CMD); }} Return tap; } Set {setmember (name, value); }}  

Never forget the Gop in the middle. The main thing is that in my XAML I can do the good stuff like this:

 < Code> & lt; ListBox x: name = "DoorsListBox" margin = "0,0, -12,0" item source = "{binding items}" & gt; & Lt; ListBox.ItemTemplate & gt; & Lt; DataTemplate & gt; & Lt; StackPanel Orientation = "horizontal" margin = "0,0,0,35" & gt; & Lt; StackPanel & gt; & Lt ;! - We use description instead of DisplayName because displayName changes for GDOs - & gt; & Lt; TextBlock TextAlignment = "Left" TextWrapping = "NoWrap" Width = "320" Text = "{Binding [Details]}" Style = "{StaticResource PhoneTextTitle2Style}" /> & Lt; TextBlock TextAlignment = "left" TextWrapping = "nowrap" width = "320" Text = "{Binding [GarageDoorStatus], Converter = {StaticResource GDOStateFormatConverter}}" style = "{StaticResource PhoneTextSubtleStyle}" foreground = "{Binding [GarageDoorStatus], Converter = {static resource GDOStateColorConverter}} "/> & lt; / StackPanel & gt; & Lt; Button DataContext = "{Binding}" content = "catalyst" IsEnabled = "right" style = "{StaticResource GDOButtonStyle}" Command = & gt "{[TriggerCommand] Binding}"; & Lt; / Button & gt; & Lt; / StackPanel & gt; & Lt; / DataTemplate & gt; & Lt; /ListBox.ItemTemplate> & Lt; / ListBox & gt;  

I am very happy with the way I work. I have tried many forms of dynamic things and till I do not affect this problem, it is doing great work.

I do not know how to specify sample XAM data for this

   VM: GarageDoorsViewModel xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft.com / winfx / 2006 / XAML" xmlns: VM = "Clr- namespace: premiseWP.ViewModels" xmlns: love = "clr- namespace: PremiseWebClient" IsDataLoaded = "false" & gt; & Lt; VM: GarageDoorsViewModel.Items & gt; & Lt; Prem: PremiseObject *** Something goes here *** / & gt; & Lt; / VM: GarageDoorsViewModel.Items & gt; & Lt; / VM: GarageDoorsViewModel & gt;  

I need some syntax to specify sample data that is "This is a dynamic property with this name and this value".

How do I do this? Is this also possible?

I'm not sure, but I think you need to set up ContentPropertyAttribute for your class . And put their values ​​for the content of the tag.

  & lt; Vm: garagedoesviewmodel.team & gt; & Lt; Love: PremiseObject & gt; & Lt; Object x: key = "key" /> & Lt; / Prem: PremiseObject & gt; & Lt; / VM: GarageDoorsViewModel.Items & gt;  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -