none
Using x:Load attribute RRS feed

  • Вопрос

  • Hello,

    I have 4 to 5 stackpanels in my UI and one of them will be shown at a time. Toggling Visibility property of StackPanel will do the job but still the controls underneath will be loaded in Visual tree and in memory. I read in msdn documentation that using x:Load attribute in this case will help.

    I am trying to use but intellisense is not showing x:Load attribute on any UI element in xaml. I understand it is supported with Windows 10 but not sure about Visual studio version.

    I am using

    Visual Studio Professional 2017, Version 15.7.3.

    Microsoft .Net Framework is Version 4.7.03056

    O.S is Windows 10.

    Please suggest.

    Thanks,

    Abdi

    22 августа 2019 г. 14:17

Все ответы

  • Hello,

    I have 4 to 5 stackpanels in my UI and one of them will be shown at a time. Toggling Visibility property of StackPanel will do the job but still the controls underneath will be loaded in Visual tree and in memory. I read in msdn documentation that using x:Load attribute in this case will help.

    I am trying to use but intellisense is not showing x:Load attribute on any UI element in xaml. I understand it is supported with Windows 10 but not sure about Visual studio version.

    I am using

    Visual Studio Professional 2017, Version 15.7.3.

    Microsoft .Net Framework is Version 4.7.03056

    O.S is Windows 10.

    Please suggest.

    Thanks,

    Abdi


    Hi abdi1234,

    When you read this documentation x:Load attribute. You can find that This attribute is used in UWP app and available starting in Windows 10, version 1703 (Creators Update). The min version targeted by Visual Studio project must be Windows 10 Creators Update (10.0, Build 15063) in order to use x:Load. In WPF app, this attribute may not be used now. If the document I refer to is wrong, please give your document link.

     
    Best regards

    Yong Lu


    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.

    23 августа 2019 г. 10:08
    Модератор