Articles about exciting challenges I come across when implementing SharePoint 2010/2013, Android apps and IOT related projects.
Thursday, February 3, 2011
Tombstoning MVVMLight ViewModels with an ApplicationBar using SilverlightSerializer
I wasn't really satisfied. When I was at the DotNed meeting at Qurius there was a discussion about saving states and what serializers would be a good option. The SilverLightSerializer was the one I remembered, so back at home I did some digging and found that LocalJoost blogged about it.
I implemented the SilverLightSerializer and just needed to replace the saving and loading state parts. Than I tested the application and found out the application bar was gone after a deactivate / activate cycle.
Before deactivating:
Then do a 'Start' and 'Back', it will activate in a state like this:
I also had this problem before using the DataContractSerializer. That was fixed by decorating the public ApplicationBar properties with [IgnoreDataMember] attribute. The SilverLightSerializer skips properties from being serialized which are decorated with the [DoNotSerialize] attribute. So I replaced the [IgnoreDataMember] with [DoNotSerialize] and the ApplicationBar was back again.
Hopes this saved you some hours of searching and testing.
Sunday, January 16, 2011
Silverlight Toolbox GestureListener not working great when developing using Remote Desktop
The Silverlight for Windows Phone Toolkit is working fine in normal environments, great toolkit. However when I started developing WP7 apps in the living room and used a Remote Desktop connection to the development machine I encountered very bad gesture responses in the Windows 7 Emulator. The Flick gesture on the emulator screen didn't do anything (well about 1 out of 100). Doing it again 1 minute later on de development machine without RDS and it worked all the time. Other gestures worked fine. Maybe it's something with the mouse events?
The XAML code I used:
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Flick="GestureListener_Flick">
</toolkit:GestureListener>
</toolkit:GestureService.GestureListener>
Code behind:
1: if (ViewModel.ViewModelLocator.MainStatic.TossCmd.CanExecute(e))
2: {
3: ViewModel.ViewModelLocator.MainStatic.TossCmd.Execute(e);
4: }
Setting a breakpoint on line 1 never kicked in.