Fixing the VisualState of your Win8 AppBar ToggleButton 4. September 2012 Shawn Windows Store (5) This post would also be called Fixing the AppBarButtonStyle for ToggleButton support in you Win8 app: Part 2 In my last post I explained how to fix the AppBarButtonStyle to support ToggleButtons. This minor fix does give you the correct style, however there are more problems. I’m not sure if it is a problem with the style, or with the ToggleButton, but after checking and unchecking the button, the state becomes completely messed up. When the ToggleButton does not have an AppBarButtonStyle set, it works great. We only get this problem when we apply one of those styles. With that said, it would seem there is a problem with the style, but the style looks just fine. I’ve seen some solutions that change the Unchecked and/or Normal VisualState back to the original style. I have not seen this working and this should happen by default. It appeared to me that the VisualState was actually getting messed up. I tried subscribing to the Click event and changing the VisualState manually. ... [More]
Fixing the AppBarButtonStyle for ToggleButton support in your Win8 apps 27. August 2012 Shawn Windows Store (2) With the RTM release of Visual Studio 2012 the Visual Studio team made some improvements to the various AppBar button styles. One of these awesome improvements was to add support for ToggleButtons. Now you can use any of these out-of-the-box styles with Buttons AND ToggleButtons. This is pretty awesome… Except for the fact that the style is missing a required TextBlock. This TextBlock toggles the color of the button. Without it you do not get a visual indication that the ToggleButton is checked. Even worse, is that the application crashes when the ToggleButton is checked. To fix this, open the StandardStyles.xaml file and go to the AppBarButtonStyle. Insert the following line directly under the “BackgroundGlyph” TextBlock <TextBlock x:Name="BackgroundCheckedGlyph" Visibility="Collapsed" Text="" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0" Foreground="{StaticResource AppBarItemForegroundThemeBrush}"/> After inserting that line, th... [More]
Adding multiple lines of text to your Win8 tile update 15. August 2012 Shawn (2) Live tiles is one of the best things about Windows Phone and WinRT. I love how easy it is to add updates to your tiles in Windows Phone but hate how limited the updates are allowed to be. With WinRT comes a new API and more robust tile updates. There are many different types of tile updates and your app should support AT LEAST one square and one wide tile. If you’re like me (and I know I am), I started with the C# WinRT sample for App tiles and badges. I began looking at the code and could easily see that you use the TileUpdateManager to update your tile. The TileUpdateManager needs a TileNotification in order to update your tile. Here is where I quickly became lost in this rather complex sample. The TileNotification needs to be created with XML (an XmlDocumentto be exact) but I had not idea what XML elements are needed (Seriously, is all of the abstraction really needed here? This is suppose to be a simple sample to let devs see how to quickly and easily create a tile update). All I w... [More]
Easily share status with your WinRT App (AKA Share Source Charm) 7. August 2012 Shawn Windows Store (1) There are two types of way to share use the Share Charm win Windows8. Your app can be a Share Source, or a Share Target. Think of Share Target as your email or Twitter/Facebook apps. Share Source is everything else. I was trying to add in the ability to share status within an app and thought it would be a pretty easy thing to do. It was easy, but took me awhile searching the web to find out how to do it. I’m hoping to make that a little easier for you. The first thing is to tell the app that users have the ability to share from your app. I thought this was going to be hidden in the app manifest file but was surprised to discover that this is done in code. To register your app as one that can share information, you must subscribe to the DataRequested event from the DataTransferManager. var dataTransferManager = DataTransferManager.GetForCurrentView(); dataTransferManager.DataRequested += DataTransferManagerOnDataRequested; I found one example o... [More]