Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Get And Set Template Programmaticaly

$
0
0

Hi 

i try get template from element and set to another element, i get template this successful but i cant set this to 

other element

this is my code

 String myXAML = System.Windows.Markup.XamlWriter.Save(TstExp.Template);

            var xamlStream = new MemoryStream(System.Text.Encoding.Default.GetBytes(myXAML));
            var myExpander = new Expander
                                 {
                                     Template = System.Windows.Markup.XamlReader.Load(xamlStream),
                                     Header = "Test Expander"
                                 };

            StcEpanderContainer.Children.Add(myExpander);


                                        

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>