Hi all!
I have trivial problem which has been bugging me for some time, hope I can put it in words..
I have created customcontrol which inherits window. Basically its usage is as simply as using native wpf window + custom look and some extra methods with it.
My custom window works just fine when developing window which is
startup window in wpf project. I can see my custom style in desingn mode and in the run.
The problem comes when I create predesigned custom window in codebehind I got my style but controls added into window wont show at all.
CustomWindow test = new CustomWindow ();
test.Show();
I assume that there could be something wrong with style, I have defined free to desing area in my window style as follows
<adornerdecorator>
<contentpresenter margin="20" />
</adornerdecorator>
UPDATE:
Just noticed weird thing. When creating predefined window like this:
CustomWindow test = new CustomWindow ();
Button btn = new Button();
btn.Content = "Hello";
test.Content = btn;
test.Show();
I get button into my custom window! So it seems that when creating custom window in codebehind it forgets its original xaml code where controls are placed in first place...
I hope you got idea :)
Cheers!