tag:blogger.com,1999:blog-5295746446529817470.post1238061991114530634..comments2023-05-09T16:29:24.130+02:00Comments on Dotnet by Example: Attached behaviors for Windows 8 Metro Style XAMLJoost van Schaikhttp://www.blogger.com/profile/02182444268071162776noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-5295746446529817470.post-81088171729931737622013-01-07T13:12:44.916+01:002013-01-07T13:12:44.916+01:00@Herman I am afraid I don't get it. Why would ...@Herman I am afraid I don't get it. Why would you want to try this on Windows Phone 8? The Windows Phone XAML stack descends from Silverlight and has EventToCommand included. You don't need my behavior at all!Joost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-3753632019032253912013-01-07T10:00:41.671+01:002013-01-07T10:00:41.671+01:00I tried to use this source and other source to com...I tried to use this source and other source to compile native for Windows Phone 8. The compilation goes well only if I use it in an XAML file the Interactivity class is not recognized. Any idea why? May be the referenced Phone8 dll's are not compatible with this, I just gave it a try but it failed.Anonymoushttps://www.blogger.com/profile/08039109533074516625noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-64062305366166034192012-07-01T13:16:35.937+02:002012-07-01T13:16:35.937+02:00@Anargyros You might want to check out the current...@Anargyros You might want to check out the current state of affairs of WinRTBehaviors. It indeed uses weak references now. Have a look at the current source code and if you have any suggestions to made, please feel free to e-mail me. I might even add you to the dev crew if you like ;-)Joost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-73285909123900714772012-06-29T17:22:07.781+02:002012-06-29T17:22:07.781+02:00Use WeakEventListener if possible to avoid the Mem...Use WeakEventListener if possible to avoid the MemLeak or closure a WeakRef inside the lambda instead of implicitly closuring the instance.<br /><br />Also i dont think it is correct to detach on Unloaded.An element can be removed and readded to the UI and then your behaviours will stop working.Detach and Attach are called when the Behaviour is *added* or *removed* from the collection.Anonymoushttps://www.blogger.com/profile/09246268232948289976noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-64324223058817873272012-04-16T08:48:06.589+02:002012-04-16T08:48:06.589+02:00@wilco_ unfortunately not unless you give me some ...@wilco_ unfortunately not unless you give me some more code. Have you been able to run the sample?Joost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-44015004375510823022012-04-14T20:00:19.967+02:002012-04-14T20:00:19.967+02:00Hi,
I'm trying to attach your DragFlickBehavio...Hi,<br />I'm trying to attach your DragFlickBehavior to a button. <br /><br />But I only get this error message:<br /><br />Failed to assign to property 'WinRtBehaviors.Interaction.Behaviors'<br /><br />Any idea?wilco_https://www.blogger.com/profile/12663920212427864836noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-13440417642712999682012-04-02T20:28:39.740+02:002012-04-02T20:28:39.740+02:00I think it might not be much difference between us...I think it might not be much difference between using Attached DPs or your version of behaviors.<br /><br />I tried to port reverse engineered versions of these myself and gave up after I found myself drowning in layers of internal implementations doing some things not available in WinRT.<br /><br />Anyways - if you just do something like this when you set your AssociatedObject in the Behavior - it should start working:<br /><br />this.SetBinding(DataContextProperty, new Binding { Path = new PropertyPath("DataContext"), Source = associatedObject });xyzzerhttps://www.blogger.com/profile/12076879161098058824noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-30555103429678986102012-04-02T20:17:00.777+02:002012-04-02T20:17:00.777+02:00@xyzzer you are right. I assumed a bit too much. D...@xyzzer you are right. I assumed a bit too much. Data binding to the dependency properties of the behavior does not seem to work. I fear I will have to resort to attached dependency properties till I found out what I need to do to get this working.Joost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-83555447618949358082012-04-01T07:32:34.313+02:002012-04-01T07:32:34.313+02:00I am wondering - you are saying you should be able...I am wondering - you are saying you should be able to data bind to your behaviors, but do you ever set their DataContext to inherit it from the object you are attaching the behaviors to? I think when they get attached - you should be binding their DataContext to the DataContext of the host object. Then again - I am not sure if you will continue to be able to set their DataContext explicitly, but I would assume that is of less importance...xyzzerhttps://www.blogger.com/profile/12076879161098058824noreply@blogger.com