WPF Design view in Visual Studio 2010--scroll the scrollbar? - wpf

I just added a ScrollViewer to my WPF app. Now some of my content is hidden because it is at the bottom of the ScrollViewer--this is intentional. However, is there any way in the Design view of Visual Studio 2010 to scroll a scrollbar so that I can preview what my app looks like when the scrollbar is at different positions? It would be convenient to check this out without having to build my Solution and run my app, just to scroll down and make sure things look as I expect.

My ScrollViewer is contained in a UserControl that does not have a height set on it. I set my ScrollViewer's height to Auto so all the contents of the ScrollViewer show in Design view in my UserControl--this way, I can see what I'm doing. I set the height of the Window that includes the UserControl, so when I run my app the ScrollViewer is bounded by that Window height, as desired.

I just removed these properties from my UserControl in Visual Studio.
d:DesignHeight and d:DesignWidth
Like yours, my ScrollViewer's height was already set to Auto.

Related

WinForms Panel's Fixed3D border is not rendered with the OS visual styles

If the BorderStyle property of many intrinsic WinForms controls, such as ListView or TreeView, is set to Fixed3D, the border of such a control is rendered using the OS visual styles (sure, if they are enabled). However, this does not work for the Panel control. Compare the ListView and Panel controls on the screenshot below:
Is there a trick that can cause the 3D border of the Panel control to be rendered with the visual styles? If not, what is workaround (say, using custom painting)?

Bootstrap css style of vertical tab control for 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.

Custom designing of inbuilt Scroll bar or Scroll Viewer of Datagrid in Silverlight

can any one please suggest me how to change style of inbuilt scroll viewer of DataGrid in Silverlight.
Right now my DataGrid is taking the default style of scroll viewer which is used in the project so I want to change that is it possible if yes then please suggest me.
If you use Expression Blend, in design mode you can right-click the datagrid > Edit Template > Edit a Copy.
In the window "Objects and TimeLine" will appear the inbuilt components, including the Horizontal and Vertical ScrollBars:
After that, in the "Objects and TimeLine" window, you right-click the ScrollBars > Edit Template > Edit Current. The XAML Window will show the ScrollBar Style:
I recommend you mannually duplicate the entire Style and make changes in the copy.

UserControl MouseButtonEventHandler Microsoft Surface Application

I have just start working with Microsoft Surface.I have designed a UserControl in Blend 4. And implemented a simple DrapDrop event over the UserControl. It works fine. The problem is, when i click over the UserControl, UserControl just jumps to another location.
For dragdrop, i have use this code
How to drag a UserControl inside a Canvas
The only design difference is, my UserControl is inside the Grid. And in this example, it is implemented inside a Canvas.
To move things around the screen on Surface, you want to use the ScatterView control.

WPF UserControl Designer Problem with Strech

I have a WPF UserControl (Foo.xaml) that should be displayed streched (VerticalAlignment="Stretch" HorizontalAlignment="Stretch") on a window.
If I don't specify Width/Height on the UserControl it will be displayed as intended at runtime. Unfortunately the VS WPF designer will not show the control correctly if I open Foo.xaml (size may be 0x0 depending on the child controls).
If I specify a size on the UserControl the designer will work correctly with Foo.xaml but then it won't strech at runtime.
How can I fix this so that it works at design and runtime?
It sounds like your UserControl is only useful if it is a certain minimum size. If so, set the MinWidth and MinHeight properties.
You can set the DesignWidth and DesignHeight properties on the UserControl to adjust the height and width of the control in the design view.
You can adjust those properties with the mouse by dragging the square rectangles that show up when you select the resize tool for the UserControl.

Resources