Bootstrap css style of vertical tab control for WPF? - wpf

I'm looking for a bootstrap CSS style of a vertical tab control, like at this page:
https://dbtek.github.io/bootstrap-vertical-tabs/demo.html
If I'm going to do it myself, what WPF control should I begin with as the base class? (I don't think the WPF tabcontrol should be a starting point because the styles are so different)
Thanks

You can re-style the TabControl and the TabItems to look like you want. It may require some effort though.
You can right-click on a TabControl in design mode in Visual Studio or in Blend and choose Edit Template->Edit a Copy to copy the default style into your XAML markup and then edit it as per your requirements. Edit Additional Templates->Edit Generated Item Container (ItemContainerStyle) will do the same thing for the TabItem container.
Also note that you can set the TabStripPlacement property of the TabControl to Left to change the position of the tabs.

Related

Choose Correct Control (TabControl,ListView,ListBox,Button) - WPF Custom Style

I want to create a theme like Apple Ipad in WPF,
if you know any , please let me know.
else, please help, to choose correct control for these Pictures in WPF (TabControl,ListView,ListBox,Button).
Thank you.
as for the top picture, it makes sense to use a TabControl where you need to:
change the template/style of the TabControl to center the TabItem headers. you can change the panel to just a StackPanel with Horizontal orientation or a custom panel.
as for the TabItem controls, you make the round corners of the first and last items by setting the attached properties IsFirst, IsLast (you need to create them).
the attached properties can be set either automatically by the custom panel, or manually via xaml.
Regards

Change style of Expander ToggleButton in Silverlight Toolkit?

I have an Expander in Silverlight 4 that I am trying to style. Specifically, I want to override the default look of the ToggleButton used in the Expander. How do I go about doing this? I've written some style for the Expander so far, but I can seem to find the place to override the default ToggleButton style.
This MSDN page gives a pretty complete description of what is needed to override the Expander.
If you have Expression Blend, another option is to start a new project in Blend, insert an expander on your window/usercontrol, then right-click on it and choose 'Edit Template'. Then you can change just the pieces you want. For my needs, this functionality in Blend is worth the cost of this software by itself.
You will need to replace the whole expander template since the expander stores the togglebutton templates (it has one for each direction) in its template and offers no way for you to provide your own.

AutoCompleteBox Dropdown width

Can the width of the dropdown be set to a different value than the AutoCompleteBox itself?
The Popup is a separate Part of the AutoCompleteBox, so it should be possible to extend that beyond the width of the text box.
In Blend, right-click on the AutoCompleteBox and select Edit Template > Edit a Copy, giving the new template a name.
Drill-down in the Objects and Timeline window to the 'Popup' part, and beneath that is a Grid. Change the width of that Grid to change the width of the popup content whilst maintaining the current width of the text box).
(I must admit I've only had chance to do this in Silverlight Spy, but it definitely works there so I can't see it being a problem doing it through Blend).
If you are not using Blend, just copy Default Style and Template of AutocompleteBox from MSDN and paste it into your App.xaml file (here is little tutorial on how to handle styles in app.xaml).
You can then modify that pasted style or template.

Style a WPF Expander to look like an Outlook ListView group header

How can you style a WPF Expander image to be +/- e.g. to look like an Outlook ListView group header as shown in the image below:
Open
Closed
Not exactly but close enough, check out this article by Karl Shifflet on WPF Sample Series – ListBox Grouping, Sorting, Subtotals and Collapsible Regions from the WPF LOB Tour Materials
(source: wordpress.com)
You would have to override the Expander's ControlTemplate, and change the ContentControl with the TemplateBinding of Header (this is usually a ToggleButton) with your header content.
In your case this is the +/- image/geometry and text.
However, I would go a different route than using an Expander. Since you're using a very specific orientation, I would just borrow the ToggleButton+ContentControl interaction that the default Expander ContentControl combines, and create a new Style/ControlTemplate for the ToggleButton instead.
The primary reason why I recommend this instead of overriding the ControlTemplate of the Expander is that Expander has a very large default ControlTemplate definition, and you won't have to deal with overriding all of the ExpandDirection options.
Alternately, you could just ignore the ExpandDirection property of the Expander and remove the ControlTemplate trigger code and associated Styles which deal with that.

Changing the style of a Combo-Box in WPF (in Blend preferably)

I'm having some issues trying to change the look / style of a combo box in Expression Blend / WPF. While there are tutorials out there describing setting styles for buttons, there seem to be a few wrinkles with ComboBox controls.
Can anyone offer any advice, or point me towards good tutorials that cover re-styling something more complex than a button?
The ComboBox style template has 3 parts to it.
The ContentPresenter you should have come across styling Buttons.
There is a Part_Popup that you should find easy to change properties on and style.
The last part is a ToggleButton, to style that you need to "edit a copy" again and create another new style template for the ToggleButton.
Have a look at BeaCostas SolarSytem Listbox it's a lovely piece of work.

Resources