开发者

Creating a WPF control that loads XAML in runtime

开发者 https://www.devze.com 2023-04-11 17:12 出处:网络
I\'m working on a WPF map application that when it loads it looks at a SQL database and according to the map that is specified there loads it as a XAML drawing (using paths on a canvas).

I'm working on a WPF map application that when it loads it looks at a SQL database and according to the map that is specified there loads it as a XAML drawing (using paths on a canvas).

I wanted to create those XAML maps as DLL's that when the app launches it will dynamically load them onto the application according to what is written in the database. What should be the best approach for doing this? How can I create those XAML maps and compile them to DLL's for dynamically loading them later in the application in runtime (the W开发者_高级运维PF control acts as a placeholder for the XAML objects and holds all the business logic)


If i understood your requirements correctly you could create UserControls for each of your maps and place them in a library, in the main application use something like ContentControl and load in the correct UserControl depending of the value from the database.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号