|
To create custom properties, see here.
For an e.g. on a control see here.
Unfortunately I could not find an example where a Path is used.
|
|
|
|
|
any example about Path & textblock??
reply fast
|
|
|
|
|
I've three grids inside a main grid as following:
<Grid Margin="10,10,10,10" Background="#FFE8E8E8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.2*" />
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="0.3*" />
</Grid.ColumnDefinitions>
<Grid x:Name="RedGrid" Margin="0,0,0,0" Grid.Column="0" Background="Red"/>
<GridSplitter Width="4" VerticalAlignment="Stretch" Grid.Column="0"/>
<Grid x:Name="GreenGrid" Margin="0,0,0,0" Grid.Column="1" Background="Green"/>
<GridSplitter Width="4" VerticalAlignment="Stretch" Grid.Column="1"/>
<Grid x:Name="BlueGrid" Margin="0,0,0,0" Grid.Column="2" Background="Blue"/>
</Grid>
I need two behaviors 'CollapseRed' and 'CollapseBlue'. CollapseRed - should collapse RedGrid(left) panel, and then GreenGrid(centre) panel should automatically cover the space on the left side. CollapseBlue - should collapse BlueGrid(right) panel, and then GreenGrid(Centre) panel should automatically cover the space on the right side. Grids are resizable with grid-splitters, and so, we should be able to make it visible again at same place/width by using separate behaviors.
Simple 'Visibility.Collapse' is not working. What change should I make in XAML, and what should be code in C#? Should I use other panels? If yes, please suggest.
So basically, I need functionality somewhat similar to SplitContainer of WinForms, where we can just on/off/change orientation of BlueGrid panel. And, Green panel adjusts accordingly.
modified on Thursday, April 29, 2010 4:20 AM
|
|
|
|
|
Can you try DockPanel instead of outer grid.
|
|
|
|
|
Hmm.. but then, can we use GridSplitters inside a DockPanel? If yes, how?
|
|
|
|
|
|
Yeah! That could be one way. It helps. Thanks!!
|
|
|
|
|
I want to put a window in a class library so i can use it in multiple places but I've noticed that I don't have the option of adding a WPF window to my project. If I right-click in the solution explorer, I can add a new item but I can only add a Windows Form (non WPF) or a "User Control (WPF)". Is there a way I can do this easily?
FYI... I'm new to this whole WPF thing so I'm still trying to figure it all out.
|
|
|
|
|
Add a User Control and change the code from UserControl to Window . It's no harder than that. There are two places to change - the XAML and the code behind; make sure you change both.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
modified on Wednesday, April 28, 2010 3:50 PM
|
|
|
|
|
I thought about that... and I did change the code. I wasn't sure about the XAML stuff though. I've only ever really used MFC and just got into WPF a few weeks ago. I'm not sure I like all this XML stuff. :-p
|
|
|
|
|
You get used to it, and it gets very addictive. It takes a bit of perserverance, but once you get it it's hard to go back.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
USAFHokie80 wrote: I'm not sure I like all this XML stuff.
Most real programmer (programmers with significant unmanaged coding experience) feel that way. If you want to experience REAL pain, try doing an entire WPF app without XAML. Only one word describes the experience, and that word starts with the letter "cluster".
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I'm getting this exception when one of my silverlight pages tries to render. Does anybody have idea why this would happen?
{MS.Internal.WrappedException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) <br />
---> System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))<br />
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)<br />
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)<br />
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)<br />
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)<br />
--- End of inner exception stack trace ---}
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Something appears to have gone wrong in the xaml.
Is something (another control perhaps) placed inside the Content of another control?
|
|
|
|
|
This started happening immediately after I installed the Infragistics toolkits (and without even using them).
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi John,
Generally we face this issue when we have a bad XAML. But in your case, did you add the reference of your external library in your project? If that is the case, then it might be because that is trying to access the same library from both the assembly.
Can you please try uninstalling the external library and reinstalling it again?
|
|
|
|
|
The Infrashitstix charts don't crash the app. I have no idea why they're interfering with the standrad charts unless its object name collisions of some sort.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
hi John i am facing the same issue and my xaml is fine, did you find the problem ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I have a path being drawn (in the shape of a triangle). I need the triangle to be the static height, but the width needs to change to fit inside its container element. How do I go about doing that? The container in question is a variable number of Border components placed in a grid (and a grid-column).
SOLUTION: Used a RenderTransform.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Awesome
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets
|
|
|
|
|
I could use some recommendations for an entry level WPF book.
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
Hy,
there are some nice articles here on CP especially by Josh Smith and the Barber(Sacha)
As for books I would recommend three:
1) Teach yourself WPF in 24 Hours by Sams(really good for beginers)
2) WPF Unleashed - also by Sams => really good book. If you're not a total begginer you could skip the first one.
3) And finally WPF Control Development Unleashed (Building advanced UX(user experiences)).
The third book should only be aproached once you have the basics figured out.
|
|
|
|
|
|
I've had this problem for years on XP and Server 2003 (newer OS's don't seem to have a problem). Whenever the resolution changes it gets into this state. The patch didn't do anything for me - I either have to restart or use the arrow keys to move through the combo box items. This could be fixed in 4.0, I have not tried. I'm still on 3.5 SP1.
|
|
|
|
|
I am on 3.5 as well. I am in a process to create a prototype and propose WPF for our new application suite. Now this bug scales down all the UI I have done so far using Transparency and rounded window etc.
Yes, this problem is specific to XP and I don't think we are upgrading to Win7 anytime soon at our enterprise level.
A naive question, ideally, to develop using .NET 4.0 would I need to upgrade to VS 2010?
|
|
|
|