I'm interested in creating a window in WPF that has a style similar to the way Visual Studio 2012 looks (the seamless window with color around edges, color is not necessary). This might not be a very programming - oriented question, but does anyone know of a library like the Fluent Ribbon library that can create this style?
Thanks!
I think if you look for the term "Custom Window Chrome" you'll get answers about what you're looking for. I wrote a library a while back that did a lot of the work for this:
http://archive.msdn.microsoft.com/WPFShell
There's also a blog post linked there that explains how it's implemented:
https://learn.microsoft.com/en-us/archive/blogs/wpfsdk/custom-window-chrome-in-wpf
Related
Goal: Edit the ControlTemplate of a Window to remove the caption buttons via Blend (Close/Minimize/Maximize). Why? Need a window with a title bar (draggable) that can't be closed/minimized/resized. It's a temporary status window that pops up, etc. (I've seen solutions that go into the Win32 APIs, and wonder why. This should be doable via Blend!)
Anyway... Blend for Visual Studio 2017 seems to be OK with my attempt. At least initially.
Click "[Window]" in the Document outline and then select "Edit Template => Edit a copy"
Blend complies and gives me this control template.
However, immediately the XAML is flagged as having errors.
I figured "well, maybe this is just a designer issue. Maybe it will build." Nope.
"The type reference cannot find a public type named 'WindowInstance'.
"The name 'WindowInstance' does not exist in the namespace
'clr-namespace:Microsoft.VisualStudio.DesignTools.WpfDesigner.InstanceBuilders;assembly=Microsoft.VisualStudio.DesignTools.WpfDesigner"
Well, I've looked for "Microsoft.VisualStudio.DesignTools.WpfDesigner" on both NuGet and in the install folders and it doesn't seem to be there.
I've also read this solution, which mentions adding "Blend for Visual Studio SDK for .NET" in the Visual Studio 2017 installer under the "Individual Components" page. I've done that. Still I have the error.
I'm uncertain where Blend got the initial ControlTemplate from in the first place if it doesn't resolve to an assembly on my machine.
Regarding the actual solution... what I'm doing now is faking a window with a title bar (that has no buttons) and using the system brushes to make it look like a window with a title bar--but that isn't draggable... which is another problem to solve.
Really, why I can't do something as trivial as removing control buttons from a window is beyond me. I suppose there are philosophical reasons to not allow people to remove the close button on a window, but that shouldn't be some arbitrary call that a dev at Microsoft gets to make for me or anyone on my team.
Thank you for your assistance.
Chad.
I would like to implement a treeview control in a WPF app that has similar look and feel as the TreeView in Visual Studio's Solution Explorer.
I've heard Visual Studio was developed with WPF.
I'm assuming Microsoft used System.Windows.Controls.TreeView for Solution Explorer.
How can I style my TreeView so that it looks and behaves like the one in Visual Studio's Solution Explorer?
Update
As Ed suggested, I used Snoop to determine that VS uses the SolutionPivotTreeView. I guess it's not opensource. I wish I could find something more actively maintained than TreeViewEx.
I'm new to Visual Studio and Blend and i'm trying to see their difference. I thought that Blend was ideal for adding more design and interactivity into your app so i chose to use this in order to create an app about a virtual museum (which i wanted to include design and 3d elements).
So far i have created 2 Grids. The 1st Grid contains a sign in or sign up option(along with its design for which i used Blend tools). The 2nd Grid is the registation form which i wanted the user to be redirected to after the user has clicked the sign up button. I'm trying to make the transition from grid 1 to grid 2 like if i had two windows forms, but i can't seem to find how i can do that. Any ideas on how to do it?
I tried to open it into Visual studio and it doesn't seem to respond that well.I suppose i must do something wrong.
So taken the previous difficulties, i'm wondering whether Blend is not necessary to use to create this kind of app and i could simply use standard Visual Studio's windows form without having problem adding design elements.
Thanks in advance
Visual Studio has all that you need to be able to do your interfaces as you want them to be. As Glen Thomas said, you should learn how to code in xaml to create your interface. Visual studio gives you a render of what it looks like in real-time while coding it so it might be helpful to do it this way.
I'm an experienced C++/Qt developer but a newbie C#/WPF developer, and I'm wondering if I'm missing something with the Visual Studio 2010 WPF designer.
In Qt, all widgets have a parent. I found this concept very useful both when building GUI programmatically and in the designer. From what I remember from Qt desginer (unfortunately my new company doesn't support Qt), you could easily drag widgets around and they get re-parented correctly. If the designer somehow got confused, then you could just reset the parent to whatever you needed in the properties box. I find the analogous ideas in WPF difficult to execute.
In the Visual Studio Designer, when I drag widgets around, they only sometimes get the right parent. More often than not, I have to go to the xaml and cut-and-paste the widget I was writing into a different part of the xaml so that it gets the right parent. I understand that the DOM tree of xaml nicely parallels the widget parent tree, but I found that was much more explicit in Qt.
So, my question is: is this cut-and-paste approach to re-parenting in WPF xaml the best you can do or are there some nice designer tips-and-tricks that I am missing?
Note: this question obviously doesn't apply when building GUI programmatically.
In my experience this boils down to a lacking designer in VS2010. Personally I use the designer for WPF as a view on how the GUI will look, and then hand code most of my XAML. I almost never actually DO anything in the designer such as drag an element or such.
To answer your question, the cut-paste in xaml approach you mention is in my experience the most efficient way to "re-parenting" elements.
Using the excellent Microsoft Ribbon for WPF for .NET 4 (not the .NET 4.5 build in class) I'm trying to achieve a ribbon like in Office 2010:
However I cannot get the File text to be shown on the ribbon:RibbonApplicationMenu.
If I change the project Wizard generated code from
<ribbon:RibbonApplicationMenu SmallImageSource="Resources\SmallIcon.png">
to
<ribbon:RibbonApplicationMenu KeyTipService.KeyTip="F" Label="File">
I get this:
Notice that the text File is not shown. What am I missing?
Looks like you will have to use GlyphRun to display custom text in the head of RibbonApplicationMenu. Please refer to the accepted answer on thread How to set text at the head of a RibbonApplicationMenu
Microsoft needs to fix this. It should work by just setting the "Label" as you described.
EDIT:
I just realized that Microsoft isn't even using the RibbonApplicationMenu...
Look at the following images again:
Microsoft Word is using just a Tab, and turning it blue! (something i haven't figured out how to do)
They really should fix this!
Also, I noticed that Microsoft's blog on the topic just uses Icons:
http://blogs.msdn.com/b/wpf/archive/2010/08/03/introducing-microsoft-ribbon-for-wpf.aspx