locked
C# Windows.UI.Xaml.Controls.Flyout

    Question

  • After migrating my app to 8.1, to add WP support with universal apps, an 'Windows.UI.Xaml.Controls.Flyout' does not contain a definition for 'HorizontalAlignment' and no extension method 'HorizontalAlignment' accepting a first argument of type 'Windows.UI.Xaml.Controls.Flyout' could be found (are you missing a using directive or an assembly reference?)

    was thrown, I have many other errors like this one, including these other one that seem to no longer exist:

    'flyout.HorizontalContentAlignment'

    'flyout.PlacementTarget'

    'flyout.IsOpen'

    I have searched all over devcenter, bing, and many other developer websites, and found no answers.

    Any and all help is appreciated, -CR.

    Saturday, April 19, 2014 1:56 AM

Answers

  • Can you explain what you mean here?

    The Windows.UI.Xaml.Controls.Flyout is new for Windows 8.1, so you couldn't have been using it in a Windows 8.0 app.

    Were you using a ToolTip before? The properties you mention appear to be from a ToolTip. Perhaps you had a custom (or 3rd party) Flyout implementation based on the ToolTip?

    See Quickstart: Adding a flyout (XAML) for tips on using the Windows.UI.Xaml.Controls.Flyout in Windows 8.1

    --Rob


    Saturday, April 19, 2014 4:00 AM
    Owner
  • They are different controls. They do similar things and have similar names, but they aren't directly related, and you need to set them up differently. See the Quickstart I linked previously for suggestions on how to change your code.

    • Marked as answer by Caedmonr Saturday, April 19, 2014 6:04 PM
    Saturday, April 19, 2014 5:08 PM
    Owner

All replies

  • Can you explain what you mean here?

    The Windows.UI.Xaml.Controls.Flyout is new for Windows 8.1, so you couldn't have been using it in a Windows 8.0 app.

    Were you using a ToolTip before? The properties you mention appear to be from a ToolTip. Perhaps you had a custom (or 3rd party) Flyout implementation based on the ToolTip?

    See Quickstart: Adding a flyout (XAML) for tips on using the Windows.UI.Xaml.Controls.Flyout in Windows 8.1

    --Rob


    Saturday, April 19, 2014 4:00 AM
    Owner
  • This is the code before 8.1:

    var flyout = new Flyout();
                flyout.Placement = PlacementMode.Top;
                flyout.HorizontalAlignment = HorizontalAlignment.Left;
                flyout.HorizontalContentAlignment = HorizontalAlignment.Left;
                flyout.PlacementTarget = BragButton;
                flyout.Content = menu;
                flyout.IsOpen = true;

    After I migrated, this code no longer worked, so in trying to figure out why, I changed it to this:

    var flyout = new Windows.UI.Xaml.Controls.Flyout();
                flyout.Placement = FlyoutPlacementMode.Top;
                flyout.HorizontalAlignment = HorizontalAlignment.Left;
                flyout.HorizontalContentAlignment = HorizontalAlignment.Left;
                flyout.PlacementTarget = BragButton;
                flyout.Content = menu;
                flyout.IsOpen = true;

    (The only references I have in my references folder are: .NET for Windows Store apps, Callisto, Windows 8.1)

    Edit: OK, after some messing around.. I found out that the callisto version and the new 8.1 flyout are conflicting so I changed "Windows.UI.Xaml.Controls.Flyout" to "Callisto.Controls.Flyout".

    And now I have a different error

    "Cannot implicitly convert type 'Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode' to 'Windows.UI.Xaml.Controls.Primitives.PlacementMode'. An explicit conversion exists (are you missing a cast?)"

    Can't figure out what to do about this one..

    • Edited by Caedmonr Saturday, April 19, 2014 3:37 PM
    Saturday, April 19, 2014 3:28 PM
  • They are different controls. They do similar things and have similar names, but they aren't directly related, and you need to set them up differently. See the Quickstart I linked previously for suggestions on how to change your code.

    • Marked as answer by Caedmonr Saturday, April 19, 2014 6:04 PM
    Saturday, April 19, 2014 5:08 PM
    Owner