Spatacoli

Category - Windows

  1. Windows 8.1 Update

    I’m a little late to the party of writing about Windows 8.1 Update, but I wanted to get a fair result. My initial thoughts on it were that I didn’t like any of the improvements they made for keyboard and mouse users. Until a couple days ago when I was forced to use Windows 8.1 long enough to install the Update. I have to concede that the keyboard and mouse improvements are wonderful. The added title bar for immersive apps is great and the addition of the power button on the start page is great. Also the addition of context menus to the start page is great. Overall I hope everyone out there in Windows 8 land updates to Windows 8.1 Update and does it soon. There are no more patches for Windows 8.1 without the Update. Also, if you are still using Windows 8 please find out how you can upgrade for free. It is very important that you are on the latest and greatest.

  2. HttpRequestException in mscorlib.dll

    If you run into this exception in a Windows 8 App:

    "A first chance exception of type 'System.Net.Http.HttpRequestException' occurred in mscorlib.dll"

    you should probably check to make sure that Internet (Client) is enabled in the App Manafest:

    appmanafest_2

  3. EventToCommand is now built into Windows 8.1!

    In MVVM code is separated to make it easier to test. You write a View Model and bind it to the View. Sometimes the View has elements that trigger events that you want to listen for in the View Model. This is where EventToCommand comes in handy. However, up till now this has been a bit of a trick to do in Windows 8 because it isn't built in. You have to use a third party extension or write all the wiring up yourself.

    Until now. Windows 8.1 is coming to the rescue. Blend for Visual Studio 2013 includes behaviors such as EventTriggerBehavior to satisfy your InvokeCommandAction needs. I'm ashamed to say though that I'm not one to hit the old "Edit in Blend" link in Visual Studio. I prefer to do all the hard work by hand. Well here's how you can do it by hand.

    The first step is to add a reference to the Windows SDK item BehaviorsXamlSDKManaged in the project. I had to unload the project and edit the csproj file directly to get this in since it didn't show on the "Add Reference…" dialog.

     <ItemGroup>
    <!-- A reference to the entire .Net Framework and Windows SDK are automatically included --> 
    <SDKReference Include="BehaviorsXamlSDKManaged, Version=12.0" /> 
    </ItemGroup> 
    

    Next we need to add some new XML namespaces to our XAML page:

    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
    xmlns:Core="using:Microsoft.Xaml.Interactions.Core"

    Here I'm using the same names that Blend gives them. I'm sure you can rename them to make them clearer. Particularly Core.

    Then you set the hooks in the XAML code. In this example I have a Button that I'm listening for the "PointerExited" event and sending in the item as a command parameter:

    <Interactivity:Interaction.Behaviors>
      <Core:EventTriggerBehavior EventName="PointerExited">
        <Core:InvokeCommandAction Command="{Binding OnPointerExited}" CommandParameter="{Binding}" />
      </Core:EventTriggerBehavior>
    </Interactivity:Interaction.Behaviors>

    Finally you hook this into your ViewModel using the same DelegateCommand infrastructure you would use for any other command.

    I know this is a brief overview, and if you'd like a full example please look me up on Twitter (@spatacoli) and ask for a full demo.

  4. Acer Iconia Ad Featuring NOOK!

    Recently Microsoft let out an ad that featured that Acer Iconia W3. This is an 8.1 inch tablet that I got at the //build conference. I use it quite a bit for reading and some lite web surfing. The neat thing about this ad below is that it is featuring NOOK not only on the Iconia, but on the iPad Mini too! Check it out!

    Windows Ad featuring NOOK!
  5. Upgrading Apps to Windows 8.1 – Deprecated Methods

    In upgrading NOOK from Windows 8 to Windows 8.1 there are four methods/properties that we were using that have been deprecated since Windows 8. Here they are and the replacement:

    1) ScrollViewer.ScrollToVerticalOffset and ScrollViewer.ScrollToHorizontalOffset have been replaced with ScrollViewer.ChangeView(OffsetX, OffsetY, ZoomLevel)

    2) ApplicationView.View has been replaced with ApplicationView.GetForCurrentView().Orientation which is an ApplicationViewOrientation

    3) DisplayProperties.LogicalDpi has been replaced with DisplayInformation.GetForCurrentView().LogicalDpi

    The first one has a catch though. Previously if the horizontal scroll width was smaller than the requested position it would fail silently. Using ChangeView though it will throw an exception. What I’ve had to do in this case is wait until the GridView is loaded then I use an anonymous method to do the horizontal scroll.

    The second one also has some interesting properties to it. Previously we were interested in if we were in snap view, but snap view is no longer used in Windows 8.1 so you need to stop looking for it. We use the Orientation to detect portrait versus landscape only. Width of the screen is detected with a size changed event.

    Let me know if you have any more methods that are deprecated that are useful to know.

  6. Hello from Windows 8

    Screenshot3_2I am writing this from Windows 8. I have been running the developer preview since last September, but just last week upgrade d all of my machines to the Consumer Preview. So far it is an interesting transition from Windows 7. Windows 8 was built around the idea of touch first, and using the OS really reminds you of this fact. Many commenters in the Internet have looked down on this fact and dismissed the entire experience as either too childlike or too much of a change. One even went so far as to claim he will switch to Ubuntu Linux because Windows 8 isn’t enough like Windows 7.

    Now you may notice that I’m not giving any link love to these people and this is intentional. Think about this: Windows 8 is so drastically different from Windows 7 that someone is going to switch to Ubuntu Linux? Ubuntu Linux is the same OS that was widely criticized last year when it switched the default desktop interface from a pure Gnome desktop to the Unity desktop. But I digress.

    Windows 8 is designed for touch based systems. However, not every touch based system is the same. Comparing the experience of using Windows 8 on the Samsung //build/ slate that was given to attendees at the //build/ conference last September and using Windows 8 on an HP TouchSmart All-in-one computer shows exactly what is meant by this. You see many of the OS interactions occur by swiping a finger onto the screen from off the screen. That first pixel around the entire edge of the screen is dedicated to OS functions. However, on the TouchSmart monitor, and many touch screens that I’ve seen, there is a bezel around the screen that extends out from the actual screen. This makes it really hard to get your finger into that little crevice to initiate the swipe. However on the Samsung slate there is no bezel and the swipe is easy and natural.

    Many people hate the idea of touching their monitor though and find the experience will get annoying. I can see that point of view, but I am not one of those people. After an all day coding exercise with the //build/ slate I went back to my ThinkPad laptop and found myself trying to touch the monitor far more often than I should. This doesn’t seem to happen when I am working on my desktop computer though. It must be the relative distance you are from the screen. When you are on a tablet/slate touch is natural. When you are on a laptop touch is starting to be less necessary, but still feels natural. A desktop computer with a monitor touch would be nice for some features, but not required. Finally, think about a 10 foot experience. The first thought that comes to my mind there is Kinect. I think this is also the answer to those that don’t want to touch their desktop monitor. Flicking a hand across the air to switch between applications seems like a very natural response.

    Here’s the trick

    Using Windows 8 with a mouse and keyboard isn’t as difficult as many people would have you believe. Since you don’t have a touch screen forget about swiping in from the bottom/top for application level menus just use a right click on the mouse. Also, forget about swiping in from the right to bring up the charms, just move your mouse to the top right corner of the screen in desktop mode and top right or bottom right in metro mode. If you want to switch applications move your mouse to the top left and you will see some white rectangular outlines appear along the left edge of the screen. Move your mouse down to open up a bar that shows what metro apps are running. This will include the desktop. You can also get this list by moving your mouse to the bottom left corner of the screen. Left clicking at the bottom left corner will also bring up the Start screen. Right clicking in the bottom left corner will bring up a power user menu of common admin apps that may be needed on the fly.

    It isn’t hard to use the new Windows interface with a mouse and keyboard. You just have to understand that it works with the mouse by moving the pointer to the corners of the screen.

    There are a host of keyboard shortcuts too, but we’ll leave those for another time. Except to say that the Windows Key on your keyboard is used for a lot more than just opening up the Start screen.

    I miss being able to move the pointer to the left side of the screen and dragging out the last application like I could with the developer preview, but I think that this new way will work better in the long run.

    I hope that everyone out there will go into this new operating system with an open mind, but we all know that won’t happen. I dread the day when I go to an employer provided Windows 8 machine and it boots to the desktop and has the old Windows 2000 Start Menu on it. I’ve seen that with Windows 7 and it didn’t feel natural, and it would feel even worse with Windows 8.

  7. Installing Windows from a Flash Drive

    I did not come up with these instructions. I found them on the web, but because I’ll never be able to find them again when I need them, I thought I’d post the instructions here for my own reference.

    From the command line run these commands:

    1. diskpart
    2. list disk
    3. select disk x
    4. clean
    5. create partition primary
    6. select partition 1
    7. active
    8. format fs=fat32
    9. assign
    10. exit
    11. xcopy D:\*.* /s/e/f E:\
    12. robocopy D:\ E:\ /MIR

    There are a few assumptions made in this. The first is that the DVD drive containing your Windows boot disk is in drive D. The second assumption is that the flash drive shows up as drive E. If either of these assumptions are wrong change line 11 accordingly.

    Beyond that look at lines 2 and 3. Line 2 will list out all the disks in your system each with their own disk number starting with 0. Look through that list and find the number associated with your flash drive. Then in step 3 replace the “x” with the number associated with your flash drive.

    Because I haven’t tested this out yet line 11 is still an xcopy. My personal preference would be to use robocopy and when I try this out I’ll use robocopy. That command will change line 11 to this:

    robocopy D:\ E:\ /MIR

    Again, I’ll try this out and report in this entry if it works or not.

    UPDATE: I was reviewing the xcopy command and the options are a little strange. /s includes all subdirectories except empty ones, and /e includes all subfolders including empty ones. It doesn’t make sense to include both options. Also /f displays the full name of each file as it’s copied. This may or may not be needed/desired. I’m currently testing the robocopy version and there doesn’t seem to be any problems.

    UPDATE 2: I was successful in using robocopy instead of xcopy. Step 11 above has been changed. All in all the install took 10 minutes! Now I need to try this on a netbook.

    UPDATE 3: Here’s the link to the original post describing how to do this: http://kurtsh.spaces.live.com/blog/cns!DA410C7F7E038D!1665.entry?wa=wsignin1.0&sa=50757250

  8. It must be nice to be an MVP (or how I stopped worrying and learned to love Vista)

    A couple weeks ago a Microsoft MVP screamed at the top of his blog that he’d give Vista 2 more weeks and then he’d leave for the murky waters of XP forever. Well some folks at Microsoft jumped onto the case and figured out the problem. I have co-workers and friends and acquaintances and people that I probably won’t ever talk to again tell me that they hate Vista so much that they’ll never use it. In some cases they never used it to begin with, but that’s a different tale. This guy rants about a sidebar app that he installed on his computer and developers jump on the case to solve the problem. I guess at the end of the day Vista doesn’t suck as long as you know people at Microsoft to help you make it work. Too bad all those other people out there will never gain the knowledge to make Vista work.

    As for the second part of his rant, he states that Windows 7 will suck simply because it is built on the same core code that Vista is built on. That tells me that he really hasn’t given Vista much of a chance. Sure, the sidebar sucks up system resources like nobody’s business, and Aero Glass also takes more than its fair share of system resources. There isn’t anything that says you have to leave them running. My wife got a new Dell computer at work the other day. She was happy that it has Office 2007 on it, but she didn’t like how slow it was. She brought it home and I turned off the sidebar and changed the system theme to Windows Classic. That computer now screams! She even said it’s faster than her old computer, but I think that’s just because she hasn’t installed iTunes yet.

    What’s the point, well the point is that the Vista core is really good. If you are contemplating a new computer you really should get Vista, but unless you have 8GB RAM and the best video card out there, I wouldn’t turn on all the goodness. Based on what I’ve seen in Vista, and remember I’ve been using Vista a lot longer than 95% of you out there, it is a killer Operating System. Windows 7 is going to kick ass based solely on what I know Vista can do. Then again, I haven’t even tried Windows 7 yet, but I’m betting I’ll have a copy in my grubby little hands in October. I’ll let you know more then.

    In the meantime, don’t believe the Apple hype. Vista is a really good operating system.

  9. Server Unleashed on Silverlight Spotlight

    The Server Unleashed web site that I built has been added to the Silverlight Showcase on silverlight.net.

    Granted I submitted it, but still it is pretty cool to see something that I worked on listed on this site.

    I have recently finished the second update to the site and hopefully it'll be going live soon.

    There will be at least one more major update and that will be for the content regarding Hyper-V!

  10. Microsoft Update

    Most people, hopefully, know that to update their Windows computer they go to Windows Update. Some people know that to update Microsoft Office they go to Office Update. What if you wanted to update both of them from one location? Go to the new Microsoft Update. This has just been released, and the link can be found right here:

    Quote

    Microsoft TechNet: Microsoft Update
  11. Critical Windows Update

    It's not "Rushed" and it's not "early", but it is the most important thing you can do today. There is a critical Windows update available on Windows Update. Anyone reading this should immediately go update your computer.

    I say it's not rushed because Microsoft did all of their normal testing and it is safe to install. Also it isn't Early in the same sense. Microsoft has just been holding on to it until "Patch Tuesday", but because some people have no morals and decided to publish details on how to exploit this vulnerability Microsoft released the patch 5 days before it was to be released.

    Patch Tuesday is the second Tuesday of every month. This is the day that Microsoft releases patches for their operating systems. Several years ago there were a lot of press and IT professionals complaining that Microsoft needed to release patches on a more regular schedule. This would help IT in planning for rollout and testing of these new patches, and it would allow the press a particular day to once again rip into Microsoft. However, it would appear that these same people are now complaining that Microsoft waited too long to release this patch. The press even went so far as to recommend people use an unofficial patch written by someone else. Please, don't do this. Microsoft's official patch is out. Use that one.

    Now stop reading this and go update your computer.

  12. Vista {hearts} RSS… but hates developers

    The RSS platform in Vista has three parts:

    • Common Feed List
    • Common Data Store
    • Platform Sync Engine

    The data itself is structured like a directory structure. At the top is Feeds (a collection of feeds). Within Feeds there are a list of one or more folders. Each folder can contain zero or more folders and zero or more Feed. Each folder also has a folder properties.... er... properties. Each Feed has one or more Item and Feed Properties. Each item has zero or more enclosures and item properties. Each enclosure has enclosure properties.

    Looks like when a sync is performed the system will create a folder structure containing any enclosures held within the feed. That means that audio-feeds (podcasts) and video-feeds will be automatically downloaded and placed into a virtual folder. This is a very good thing for managing synchronization of these items to various devices.

    The sync engine will perform most of the really boring aspects of getting RSS feeds. Namely inserting new items, updating existing items, and ignoring the hell out of old crap. Can you tell how much I enjoy doing that part of it today?

    Everything up to this point sounds great, and it reads great on this page. Now this is where I get lost. I'm excited about it. This weekend (Labor Day weekend here in the US) I've decided that I will only run Windows Vista on my main machine. I will immerse myself in trying out all the cool things in Vista. Specifically I am looking at trying out the Auxiliary Display Platform, the MMC 3.0, and of course RSS. I installed the PSDK, and I have my trusty Beta 2 of VS 2005 all hot and ready for action. This is where the problem occurs. What is the name space for all of this cool RSS functionality? Where are they hiding it? It isn't listed in the PSDK, and I can't find any code samples anywhere on the web. Did they take it out at the last minute?