tag:blogger.com,1999:blog-41889549673845739.post7562255931140187790..comments2017-11-28T21:33:38.085-08:00Comments on Silverlight Scratchpad: A Behavior for Remembering SettingsPhil Middlemisshttp://www.blogger.com/profile/03935276958686024115noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-41889549673845739.post-8905319584978893952011-01-20T10:25:41.108-08:002011-01-20T10:25:41.108-08:00The behavior is not designed for persisting whole ...The behavior is not designed for persisting whole collections of child objects, just single properties with values that can be converted to a string and back. It will not work with the Canvas.Children property since that is a read only property of type VisualCollection.<br /><br />It would possibly work with a ListBox.ItemsSource since that is a writable property, but you would have to also provide a custom converter to translate to and from string and IEnumerable.<br /><br />The Interaction.Behaviors property is an attached property that you are already using in the XAML to contain the TotalRecall behavior. For more info, follow <a href="http://lmgtfy.com/?q=Silverlight+Interaction.Behaviors" rel="nofollow">this link</a>Phil Middlemisshttps://www.blogger.com/profile/03935276958686024115noreply@blogger.comtag:blogger.com,1999:blog-41889549673845739.post-40758920470047892832011-01-20T00:49:58.982-08:002011-01-20T00:49:58.982-08:00Can you give me rough idea about the interaction b...Can you give me rough idea about the interaction behavior you are talking.<br />actually i want to persist Canvas's Children & ListBox's ItemsSource.I am doing something like below<br /><br /> Canvas x:Name="myCanvas" Background="Chocolate" Grid.Column="1"><br /> i:Interaction.Behaviors><br /> TotalRecall:Recaller Data="{Binding Children,ElementName=myCanvas,Mode=TwoWay}"<br /> <br /> </Canvas<br /><br />I am doing all code when element is loadedUnknownhttps://www.blogger.com/profile/14335123094173377534noreply@blogger.comtag:blogger.com,1999:blog-41889549673845739.post-66363113022415282752011-01-20T00:46:34.223-08:002011-01-20T00:46:34.223-08:00This comment has been removed by the author.Unknownhttps://www.blogger.com/profile/14335123094173377534noreply@blogger.comtag:blogger.com,1999:blog-41889549673845739.post-5430466622573001992011-01-19T10:27:20.441-08:002011-01-19T10:27:20.441-08:00h, I'm guessing there is some behavior code in...h, I'm guessing there is some behavior code in your sample that is not showing up in the comments.<br /><br />If you are trying to bind the behavior to Canvas.Left then user the following syntax on the behavior (note the parentheses):<br /><br />{Binding (Canvas.Left), Path=Rect}<br /><br />For code behind you need to add the behavior to the rectangle's Interaction.Behaviors attached property (you may have to create the BehaviorCollection) and set the binding on the behavior by hand.<br /><br />Have a google for how to do these things, and if you get stuck let me know and I will do a short blog post on how to do it.Phil Middlemisshttps://www.blogger.com/profile/03935276958686024115noreply@blogger.comtag:blogger.com,1999:blog-41889549673845739.post-25213180969946789972011-01-19T03:16:05.471-08:002011-01-19T03:16:05.471-08:00one more thing what would i do if i am adding my c...one more thing what would i do if i am adding my controls from Code BehindUnknownhttps://www.blogger.com/profile/14335123094173377534noreply@blogger.comtag:blogger.com,1999:blog-41889549673845739.post-53427212241059655602011-01-19T03:15:10.550-08:002011-01-19T03:15:10.550-08:00Hi its working fine with example but i tried follo...Hi its working fine with example but i tried following example and its not working<br /><br />Rectangle x:Name="Rect" <br /> Margin="100 10 50 120"<br /> Height="100" <br /> Width="100" <br /> Canvas.Left="{Binding ElementName=LeftPositionTextBox, Path=Text, Mode=TwoWay}" Fill="Aqua" <br /> Canvas.Top="{Binding ElementName=TopPositionTextBox, Path=Text, Mode=TwoWay}"><br /> <br /> <br /> <br /> <br /> </Rectangle<br /><br /><br />awaiting your reply ASAPUnknownhttps://www.blogger.com/profile/14335123094173377534noreply@blogger.comtag:blogger.com,1999:blog-41889549673845739.post-5026564109915849692010-11-24T07:39:03.691-08:002010-11-24T07:39:03.691-08:00sexy!sexy!_Mr_Ehttps://www.blogger.com/profile/06385579223873492944noreply@blogger.com