none
[UWP]Overriding Pivot style

    Question

  • I copied and pasted all the code on this page (https:\\msdn.microsoft.com\en-us\library\windows\apps\mt299144.aspx?f=255&MSPPError=-2147217396) into App.xaml verbatim, but the application crashes and no information is given as to why. When I remove the overrided template from the style alone, it no longer crashes, but then I can't override the template.

    What is the deal here? I've never had this issue when developing classic desktop apps, but UWP seems to make this unnecessarily complicated.

    Due to a stupid bug, I can't post links so just replace the backward slashes with forward slashes. At any rate, you can find the default style by Googling it.


    Sunday, March 19, 2017 8:17 PM

All replies

  • Hi CSharpIsBoss,

    I also copy the style to the App.xaml, but it works well, I can change the template as well.

        <Application.Resources>
            <!--  Default style for Windows.UI.Xaml.Controls.Pivot  -->
            <Style TargetType="Pivot">
    ...<!-- using the style code of https:\\msdn.microsoft.com\en-us\library\windows\apps\mt299144.aspx?f=255&MSPPError=-2147217396>
            </Style>
        </Application.Resources>

    Could you tell me how you add it and how to use it with the Pivot control?

    Best regards,

    Breeze Liu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 20, 2017 11:15 AM
    Moderator
  • Never mind. I just pasted the code into a blank project and it worked, then pasted it again in my real project and it worked there too. Must've been something else I overlooked. Any way to delete the question? Doesn't really offer any usefulness at this point.
    Monday, March 20, 2017 3:31 PM
  • Hi Epsilon Halo,

    You can delete this thread by clicking the Delete tab below your issue. Besides, if you agree, we can help you to delete it.

    Best regards,

    Breeze Liu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 21, 2017 6:48 AM
    Moderator