What is the best way to reuse blocks of XAML?

后端 未结 1 1901
天命终不由人
天命终不由人 2021-02-04 08:28

I\'ve got many user controls like this:

PageManageCustomers.xaml.cs:

public partial class PageManageCustomers : BasePage
{
 ...
}
         


        
1条回答
  •  春和景丽
    2021-02-04 09:22

    Use resource dictionaries - add a MyDictionary.xaml file to your project, setting its Build Action to "Page":

    
        
            
                
                
                
            
        
    
    

    Then in other XAML files you refer to it with:

    
        
            
        
        ... some other local resources ...
    
    

    and refer to your resource as Template={StaticResource manageAreaCellTemplate}.

    0 讨论(0)
提交回复
热议问题