johnvisiomvp

Life with Visio and other Microsoft Toys!

Archive for the ‘Dev’ Category

Stand up and be counted.

leave a comment »

Last Year I joined a number of the Canadian MVPs for a day of NDA, skill improvement and general interactions.

For most of the sessions, the key word was caNaDA, so the only thing I can say about those sessions is the Microsoft has some interesting announcements coming up in the near future. Of course, some of the skill building sessions were not and I can talk about them.

There were several sessions on how to make presentations, from preparing to presenting. Unfortunately, there were a number of death by PowerPoint comments. PowerPoint is a tool and as such, the power of that tool is in the hands of the presenter. Only a poor workman blames their tools. PowerPoint has a lot of power and can greatly enhance a presentation, but you need to learn it properly and practice with it. It is not a crutch, so do not overload it with information. Keep it simple. The slides have a notes feature for highlighting points about the slide, possibly question that the slide may invoke.  Audience tend to ask if the slides will be published. So a little extra in the slides would be appreciated.

Enjoy.

John Marshall… Visio MVP       Visio.MVPs.org

Advertisements

Written by johnvisiomvp

March 27, 2017 at 6:36 pm

UWP Samples generate hundred of errors?

with one comment

For the past few months I have had problems trying to run any of the Windows 10 UWP samples. Each attempt resulted in hundreds of errors.  Yesterday, thanks to Colin Melia and a little Google spelunking I may have found the issue and the solution.

The Googling turned up https://github.com/Microsoft/Windows-universal-samples/issues/182 which indicates the same issues and that the problem may be with one of the references, Microsoft.NetCore.UniversalWindowsPlatform. Since I have been having issues, I did a clean install and installed the Windows 10 SDK. The issue appears to be that the samples were created with the 5.0 version of that file, but the clean install used 5.1. So when trying to open the samples, the reference could not resolve.

The solution was to open the project, in the Solution Explorer, right click reference and chose Manage NuGet Packages… Select Microsoft.NetCore.UniversalWindowsPlatform and select Update. I was able to do a Clean Project and Run.

No more errors!

Hopefully this will work for others.

Remember, if your solution contains more than one project, you probably will have to do this for each project.

Enjoy.

John Marshall… Visio MVP       Visio.MVPs.org

Written by johnvisiomvp

April 17, 2016 at 4:21 pm

WP7 Multilingual AppBar.

with one comment

The current phone app I am working on is based around a pivot and to get the most out of the pivot I want to use a different appbar for each pivot item. Luckily, Microsoft has a good article on how to do it.

How to use different app bars in a single Pivot control for Windows Phone

Unfortunately, the article has a few problems. The main ones deal with a need to know. This is a pivot and this article suggests placing the appbar in App.xaml. This is a pivot and only the page with the pivot needs to know about it or cares. This also means the background code will be in App.xaml.cs which complicates things. Since most of my apps have been multilingual, the solution did not handle the binding required for the resource file.

So the solution was to take the idea and move it to the page that had the pivot. This meant changing the xaml code from using Application.Resource to phone:PhoneApplicationPage.Resources and use throwaway values for the text. The SelectionChanged method of the pivot would take care of adding the correct text. Since I like to have optional menu items and there is no way to hide menu items, I left that up to the code behind and removed any references to the appbar menu from the xaml code. The resulting SelectionChanged method looked like.

private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
switch (((Pivot)sender).SelectedIndex)
{
case 1:
ApplicationBar = ((ApplicationBar)Resources["AppBar1"]);
((ApplicationBarIconButton)ApplicationBar.Buttons[0]).Text = AppResources.AppBar1a;
((ApplicationBarIconButton)ApplicationBar.Buttons[1]).Text = AppResources.AppBar1b;
((ApplicationBarIconButton)ApplicationBar.Buttons[2]).Text = AppResources.AppBar1c;
((ApplicationBarIconButton)ApplicationBar.Buttons[3]).Text = AppResources.AppBar1d;
break;
case 2:
ApplicationBar = ((ApplicationBar)Resources["AppBar2"]);
((ApplicationBarIconButton)ApplicationBar.Buttons[0]).Text = AppResources.AppBar2a;
((ApplicationBarIconButton)ApplicationBar.Buttons[1]).Text = AppResources.AppBar2b;
((ApplicationBarIconButton)ApplicationBar.Buttons[2]).Text = AppResources.AppBar2c;
break;
default:
ApplicationBar = ((ApplicationBar)Resources["AppBar0"]);
((ApplicationBarIconButton)ApplicationBar.Buttons[0]).Text = AppResources.AppBar0a;
((ApplicationBarIconButton)ApplicationBar.Buttons[1]).Text = AppResources.AppBar0b;
break;
}
ApplicationBar.MenuItems.Clear();
ApplicationBar.IsMenuEnabled = true;

ApplicationBarMenuItem appBarMenuItem;
appBarMenuItem = new ApplicationBarMenuItem(AppResources.lblLive);
appBarMenuItem.Click += new EventHandler(Click_Live);
ApplicationBar.MenuItems.Add(appBarMenuItem);
if (App.isTrial)
{
appBarMenuItem = new ApplicationBarMenuItem(AppResources.lblBuyNow);
appBarMenuItem.Click += new EventHandler(Click_Buy);
ApplicationBar.MenuItems.Add(appBarMenuItem);
}
if (App.EdomDog)
{
appBarMenuItem = new ApplicationBarMenuItem(AppResources.lblEdomDog);
appBarMenuItem.Click += new EventHandler(Click_EdomDog);
ApplicationBar.MenuItems.Add(appBarMenuItem);
}
}

Now, as the app evolves, I have an easy framework to build the appbars on. The code is contained to the page that needs it, it supports multiple languages and it supports optional items.

John Marshall… Visio MVP       Visio.MVPs.org

Written by johnvisiomvp

January 15, 2014 at 9:42 am

WP7 Database Caveat

leave a comment »

Lately I have been playing with Pivots for the WP7 and how to add filtering. I did have a MVVM example that I was able to add filtering and convert it to a pivot, but I am not sure the final result was the best way. Susan Ibach, aka HockeyGeekGirl, pointed me to a recent post on how to create a database for Mango. The downloaded version had an issue with a missing reference to the toolkit, so I tried the long way and followed the instructions in the article. Actually, it was not that hard, just a lot of copy and paste. With the instructions, it explained how to install the missing toolkit.

The one gotcha was that the toolkit was premango and installs in C:/Program Files (x86)/Microsoft SDKs/Windows Phone/v7.0/ rather than C:/Program Files (x86)/Microsoft SDKs/Windows Phone/v7.1/. Minor point, but I did spend some time looking in the 7.1 directory for the SilverLight toolkit.

The app now works and it is time to start dissecting it.

John Marshall… Visio MVP       Visio.MVPs.org

Written by johnvisiomvp

July 14, 2011 at 1:24 pm

Posted in Dev, Windows Phone 7, WP7

Tagged with , ,