locked
Under Windows 8.1, My Win8.0 Store App which create by VS 2012 cannot custom template of Slider

    Question

  • My environment is  Win8.1 + Visual Studio 2012

    When I create a new Windows Store Project as following:
    [File] > [New] > [Project] > [Windows Store] > [Blank App]

    Then add Slider element into Grid of MainPage.xaml as following:
        <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
            <Slider HorizontalAlignment="Left" VerticalAlignment="Top" Width="325" Margin="269,169,0,0" Value="70"/>
        </Grid>


    I need custom this Slider by following step:
       1.Using mouse right click this Slider, then [Edit Template] > [Edit a Copy]
       2.On [Create ControlTemplate Resource] dialog, click [OK] button.

    But VS2012 has following error message:

    An Exception was thrown.
    XamlParseException: The text associated with this error code could not be found.

    Cannot apply a Style with TargetType 'Windows.UI.Xaml.Controls.Slider' to an object of type 'Microsoft.Expression.WindowsXamlPlatform.InstanceBuilders.WindowsUIXamlViewNodeManager+FallbackControl'. [Line: 161 Position: 199]
    StackTrace
       at Windows.UI.Xaml.Controls.Control.ApplyTemplate()
       at Microsoft.Expression.WindowsXamlPlatform.InstanceBuilders.WindowsUIXamlViewNodeManager.EnsureElementInDictionary(Object root, ViewNode knownAncestor)
       InnerException: None


    If my OS is Windows 8.0 and using Visual Studio 2012, about procedure is no problem.

    Does Anybody know how to solve this error?

    vulcan

    Saturday, October 26, 2013 3:19 PM

Answers

  • Hi Vulcan,

    I was able to reproduce this on Windows 8.1 in both Visual Studio 2012 and Blend for Visual Studio 2012. Opening the same project in Visual Studio 2013 without upgrading it to a Windows 8.1 app did not show the error. That may be a useable workaround for you. Other than that you could try disabling the custom template and at design-time.

    I'll let you know if I find anything else once I have a chance to dig deeper into this.

    --Rob

    • Marked as answer by Vulcan LeeMVP Tuesday, October 29, 2013 1:49 AM
    Tuesday, October 29, 2013 12:45 AM
    Owner
  • Hi Bob

    Your suggestion is a good choice.


    vulcan

    • Marked as answer by Vulcan LeeMVP Tuesday, October 29, 2013 2:59 AM
    Tuesday, October 29, 2013 1:51 AM

All replies

  • Hi Vulcan,

    I'll move this to an appropriate forum where you'll be more likely to find somebody who can help during the weekend. As a first step I'd see if you get the same problem in Visual Studio 2013 or if it is Visual Studio 2012 specific.

    The UI Design for Windows Store apps forum is for discussing application design, not implementation or tools.

    --Rob

    Saturday, October 26, 2013 9:56 PM
    Owner
  • I'm having the exact same issue.

    [url=http://catalog.create.msdn.com/en-US/GameDetails.aspx?catalogEntryId=5cbacba6-05c2-4c33-9005-6cc80c8d5753&type=1]Bible Trivia Avatar Edition[/url], currently in review.

    Saturday, October 26, 2013 10:21 PM
  • Hi Rob

    I need create my app using Visual Studio 2012 because my customer want his app can run on both Windows 8.0 and Windows 8.1.

    I have try same procedure for Visual Studio 2013 ( create new project, put Slider control on Grid, custom Template), it is working.

    I think this problem only happen on this environment: Visual Studio 2012 + Windows 8.1 OS.


    vulcan

    Sunday, October 27, 2013 4:18 PM
  • Hi Vulcan,

    I was able to reproduce this on Windows 8.1 in both Visual Studio 2012 and Blend for Visual Studio 2012. Opening the same project in Visual Studio 2013 without upgrading it to a Windows 8.1 app did not show the error. That may be a useable workaround for you. Other than that you could try disabling the custom template and at design-time.

    I'll let you know if I find anything else once I have a chance to dig deeper into this.

    --Rob

    • Marked as answer by Vulcan LeeMVP Tuesday, October 29, 2013 1:49 AM
    Tuesday, October 29, 2013 12:45 AM
    Owner
  • Hi Bob

    Your suggestion is a good choice.


    vulcan

    • Marked as answer by Vulcan LeeMVP Tuesday, October 29, 2013 2:59 AM
    Tuesday, October 29, 2013 1:51 AM
  • How do you do this. I'm told that I must retarget my app, otherwise the project won't load.

    [url=http://catalog.create.msdn.com/en-US/GameDetails.aspx?catalogEntryId=5cbacba6-05c2-4c33-9005-6cc80c8d5753&type=1]Bible Trivia Avatar Edition[/url], currently in review.

    Friday, November 08, 2013 5:46 PM
  • Visual Studio 2013 Express for Windows supports only Windows 8.1 apps, not Windows 8 apps. If you load a Windows 8 app in it then you will need to retarget the app for Windows 8.1.

    Other Visual Studio 2013 versions can open and build existing Windows 8 apps without retargeting.

    Saturday, November 09, 2013 12:52 AM
    Owner