The default template for TabItem, as defined here, assumes that the tab strip is at the top. If we change the TabStrip.TabStripPlacement to the right, left or bottom, the margins and border thicknesses don't make sense. How would someone go about changing these values based on the parent TabControl TabStripPlacement. This is for a style used in application resources not just for a specific instance of the control.
To answer my own question. I found out that there is actually a TabItem.TabStripPlacement that can be used on the control template triggers
Related
I make my own style for datagrid, I had changed every thing but there's a small part of datagrid make me crazy, because I can't change color for this part. I don't know the name of this part, as showing in the image :
How can I change color it?
It's not so clear from your image, but if that part is part of the ScrollBar then you can add a Style without defining an x:Key for it into your DataGrid.Resources section. That way, it can be implicitly applied to the ScrollBar parts. You can start with the default Style and then adjust it for your needs. You can find the default Style in the ScrollBar Styles and Templates page on MSDN. There is quite a lot of it so you'll have to do some experimentation with it.
UPDATE >>>
If you are talking about the Buttons that you can click to select the row, I believe that that part is called the row header. You can add a Style for that using the RowHeaderStyle property. Please see the WPF override DataGrid RowHeader template and manage to select rows still post for help with that.
Alternatively, I believe that you can hide it altogether by setting the DataGrid.RowHeaderWidth property to 0.
Hy.
Could you help me create the fallowing control style/template?
What do I need:
A (Vertical and Horizontal) ScollBar Style like that. (Without the two arrow button)
Inner shadow on the top and bottom of the "ScrollViewer area".
That's all I need, I can create the rest parts of the control. (Selected Item's color etc)
Thank you.
The scrollbar control in WPF can be thought of as collection of the two repeatbuttons and the track part. You can change the template of the scrollbar and remove the repeatbutton.
For the shadow part, you need to provide the the Zorder index. Refer to the following link - WPF shadow on stackpanel controls
I know is too late for an answer but Style is very easy to get if you understand basic templating. Here you will find a Scrollbar that emulate the one you want, hope you like it.
This is a sort of extension of this question I asked yesterday (the question gave me a contentcontrol that can overlay the current control). I now have a contentcontrol that can be overlayed on the current control via bindings (a modal type window). This works well and I am happy with this. One great feature would be if I could get the overlay to go over its parent.
currently the overlay will go into "My Control" control. What I would like is if I can still define it in that control (as that is were it is needed), but when it is displayed it can cover the whole main content area and / or the main window.
is this even possible?
Thanks
Sure it's possible, just wrap it into a Popup! :) You might have to manually stretch it though, but Popup is the control which will let you go outside the bounds of the parent view.
Another way is to host the MainContent in a grid and add a collapsed content control after the MainContent.
To show the popup: put it in the collapsed content control and make it visible.
To hide the popup: collapse the contentn control and remove the popup.
I have to change Listbox's control templated in a way that it can look like below image
alt text http://www.freeimagehosting.net/uploads/05598e4d35.png
i have added togglebutton in listboxdatatemplate...
have one stackpanel in listbox style template...
so structure is like
border - stackpanel - grid - itemcontainer[boder-togglerbutton]
now to make first and last item curved... what are the ways...
if i make stackpanel border curved... when firstitem is selected and its background is changed... it shows a square inside outer border... so i am not able to get look showed below...
any idea?? how to get design done in the way with listbox tht can be showed like image above...
in image 1,3 and 4 items are selected and others are in normal mode...
-thanks in advance
I did it with a listbox in Blend inside of the ItemTemplate by creating a leftBorder and a right Border that are in the same space. The leftBorder is defined with cornerRadius 10,0,0,10 and the right with cornerRadius 0,10,10,0. I then set them both to opacity 0 (you can use visibility if you prefer) and set a ChangePropertyAction on both of thier loaded events conditional on the first and last item in your list.
That is the bad part, I did need to do it conditional on the items in your list but you could define another property and set that to first and last or create multiple templates that you set if there are no more items in the list from the control (not in the template).
If you think this may be interesting to you, let me know and I will post on my blog as well as try to make a couple of adjustments for your situation. I am not sure how to upload a project to here.
I'm building a silverlight app in Blend that will contain a treeview and treeviewitems. The contents of my treeviewitems all have a blue border (when clicked and when you hover the mouse over), as you can see in the image I linked to. I cannot figure out what causes that border, or how to remove it; anyone know where to get at it? I've tried looking in the various treeview related templates, but I've had no luck so far.
I think what you are seeing here is the FocusVisual:
http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.focusvisualstyle.aspx
If you set this to {x:Null} (via FocusVisualStyle), it should go away...if not, you're likely dealing with a "selected" VisualState, in which case your best option is to override the template to remove that particular state.