timheuer / callisto

A control toolkit for Windows 8 XAML applications. Contains some UI controls to make it easier to create Windows UI style apps for the Windows Store in accordance with Windows UI guidelines.
http://timheuer.com/blog/archive/2012/05/31/introducing-callisto-a-xaml-toolkit-for-metro-apps.aspx
Other
338 stars 108 forks source link

ver 1.2.1 - Flyout Control stopped working after upgrade to ver 1.2.1 #73

Closed iTrout closed 12 years ago

iTrout commented 12 years ago

Flyout code worked fine in versions 1.1.0 and before...code has not changed, but after upgrading to version 1.2.1 the line:

        flyOut.IsOpen = true;

returns the following error.

       Windows.UI.Xaml.Markup.XamlParseException: Unspecified error
            at Windows.UI.Xaml.Controls.Primitives.Popup.put_IsOpen(Boolean value)
            at Callisto.Controls.Flyout.<.cctor>b__3(DependencyObject obj, DependencyPropertyChangedEventArgs args)

We've replicated the problem on different Windows 8 machines with the same unchanged code.

timheuer commented 12 years ago

I'm not able to reproduce this. Are you using an RTM build of Windows? Does the testapp work fine for you?

iTrout commented 12 years ago

We are using Windows 8 Release Preview, Evaluation Copy. Build 8400. For Visual Studio, we're using Microsoft Visual Studio Professional 2012 RC, Version 11.0.50522.1 RCREL

We've created a simple test that works on 1.1.0 but still gives the same error on 1.2.1...here's the c# code behind:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Callisto.Controls;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace App105.APDtest
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class FlyoutTest : Page
    {
        public FlyoutTest()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {

        }

        private void MyButton_Click(object sender, RoutedEventArgs e)
        {
            Flyout f = new Flyout();

            // Flyout is a ContentControl so set your content within it.
            f.Content = new Border() { Width = 500, Height = 500 };

            f.Placement = PlacementMode.Top;
            f.PlacementTarget = sender as UIElement; // this is an UI element (usually the sender)

            f.IsOpen = true;
        }
    }
}
timheuer commented 12 years ago

If you are on RP you shouldn't be using 1.1.0 to begin with. RP isn't guaranteed to work on anything past 1.0.11 at this point.

However, I haven't changed any Flyout code from 1.1.0->1.2.1

iTrout commented 12 years ago

Downloading RTM as I type...will install tonight and see if the world is back in place. Thanks for you quick responses and help.

timheuer commented 12 years ago

Please do. I suspect it actually has nothing to do with Flyout but a different definition in generic.xaml that is causing the parse exception due to a base style that is no longer present in RP

iTrout commented 12 years ago

Upgraded to RTM...everything is working perfectly now. Thanks for the help!