How I do define and apply themes to my custom control that is hosted in an ElementHost.
VS created Generic.xaml in the Themes folder. If I renamed it to something else (like Blue.xaml), the entire control does not show up.
Another question is what theme xaml files should be set to in VS: Content, Page or Resource?
You should always have a Generic.xaml defined.
Copy it, and then change your Blue.xaml to define your "Blue" theme.
Build Action = Page
See as you're hosting your WPF control in a Windows Forms Application with ElementHost, then you might have difficulty in it seeing changes to the theme.
See:
http://www.actiprosoftware.com/community/thread/20266/how-to-get-themes-working-inside-an-elementho
Dynamic Application-level resources are not dynamic when hosted in ElementHost
Related
How to set theme for devexpress ribbon control in WPF? Already installed the WPF theme editor, but there is no item in the product browser to select. I tried property ribbon style, but it does not work either.
Your main window should start with <dx:ThemedWindow > tag.
Add theme references to project by context menu on the references section, DLL names start with DevExpress.Xpf.Themes. ...
Click on smart tag button for the form.
Select application theme from the combobox.
p.s: this solution applies to .net 4.7 or equivalent
I created a custom TimePicker control. It has a label and some combo boxes on it. It is inside a UserControl library.
Now I added a reference to that project in my Desktop project and added the TimePicker to a window.
Finally, I have some styles defined in a 3rd project. I would like to create a style in the Styles project for the TimePicker on my window.
How do I set that TimePicker's style in the Desktop project?
Load Resource Dictionary from your style project.
Set button style defined in your Resource Dictionary.
I am using a customized alert message for my whole application which generates from a .js file and a .css file. I have also used silverlight in my application and shows MessageBox from silverlight with its default design. Now i want to customized that MessageBox in silverlight.
So, can anyone plz help me to know how to add js and css file to silverLight application and how to use it
You can't change the built-in MessageBox style as easily as simply creating your own modal window. There are lots of custom messageboxes about and many have source code.
e.g.
Creating a reusable MessageBox dialog.
Silverlight Modal Dialog With Custom User Controls
Custom MessageBox Control for Silverlight 3
Note: these are all Silverlight solutions, so you are authoring in XAML and with style, not using JS and CSS.
It is also possible to call JS functions on the page from within Silverlight if you think that will be easier for your solution.
I have a Silverlight application and I am trying to make each step of a wizard in XAML files, instead of hard-coded C#.
The problem is that I don't understand how I am going to switch between them after click on next button of each screen.
What is the best way to do this? I saw some tutorials on the internet about XAML dynamically loaded but none of them seem to work with me :/
Use a ChildWindow as your parent window. Then create multiple UserControls which will be framed in the content of the parent window. In the code-behind of the parent window, load the user controls into a list and set the visibility to 'Collapsed' for all of them but the first. When the user presses the Next/Prev buttons, pull the appropriate UserControl from the list (keep track of the current index) and make it 'Visible' while making the current control 'Collapsed'.
All of your navigation code will be in the parent window, but the parent window won't be concerned about the content of the wizard steps itself.
Each UserControl can be coded in XAML as a separate control so you still maintain a separation of the control from your wizards navigation logic.
You can then create a class type that will hold all of the options for the various wizard controls. Pass a reference to an object instance to each of the controls for them to update. When you get to the end of the wizard, your option object should maintain the state of all the wizard steps and the parent window can return that to the application.
I would suggest looking into the Silverlight Navigation Framework. It allows you to use "urls" to navigate between "pages" (which are your XAML user controls). It also also users to use the back and forth buttons in the browser, which may or may not be something you want to allow.
There is a VS 2010 template when you choose New Project, Silverlight, "Silverlight Navigation Application" that will help get you started.
I am really new to Silverlight. I am working through some of the sample codes I found online.
I notices sometimes a new "Page" is added, and sometimes a new "User Control" is added.What are the differences between those 2?
Btw, when I tried specifying the URL for a hyperlink as "www.apple.com", there is an error saying "www.apple.com" can not be found. Are there anyway of specifying an URL for a website for a HyperlinkButton?
Thanks :)
In SL3 and up; a Page correlates to the Navigation framework whereas a UserControl is a control providing a defined set of functionality using multiple controls which can then be used within a Page.
User Control:
When you build your project , any user control that you created will appear in the toolbox also. You can drag and drop it like any other control (like a button or a grid).User controls are used for enhanced flexibility. You can customize your controls, set as many properties you want , and it really simplifies things without going for creating custom controls.
Page:
However, when you come to a Page, you can use it mostly for Navigation . It can contain other controls , but it is mainly intended for Navigation within Frames.