|
Thanks Pete O'Hanlon. Exactly the same thing I was looking around...
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
Hi!
i have created tree view demo in WPF by Using sir Josh Smith sample code but i want to give header and when header is clicked it sort data. i want to create demo like this
header1………….header2……….header3
-parent1…………..parent2………..parent3
…-child1……………-child1………….child1
……child1……………-child1…………child1
-parent2…………..parent2………..parent2
…-child2……………-child2………….child2
……child……………-child2…………child2
parent3…………….parent3………..parent3
plz suggest any link or samples code.
thank you!
|
|
|
|
|
Hi,
I am working on WPF controls, I have a halt at adjusting one of the controls programatically.
I have 2 radiobuttons (rdbtn1, rdbtn2) and a dockpanel(2 controls) with a stackpanel(with textbox and button)a another stackpanel(with 2 textboxes).
so the panels are placed at (40,10,0,0) and (40,150,0,0) with panel1 above and panel2 below it.
actually the problem is selecting one of radiobuttons .
if i select rdbtn2, the panel1 shuld be invisible and the panel2 should stretch (not shift, which mean if the panel2 height is 200 and it should stretch its starting point in vertical to 10 and its lower limit should be same , making total height of 140 + 200 )to the panel1 starting location .
so, only panel2 shuld be visible. how to do this programatically in C#?
Please help..
Thank you,
Ramm
|
|
|
|
|
I would put them in a stackpanel or a grid, and try to set them up so their size is determined by the available space, so that when you collapse one, the other would fill the space.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Okay, I found out what's eating my (non-keyed) global style. I had this in my app.xaml (my global textbox style is in Styles.xaml):
<ResourceDictionary Source="/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component/themes/aero.normalcolor.xaml" >
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WpfTest;component/Dictionaries/Resources.xaml" />
<ResourceDictionary Source="/WpfTest;component/Dictionaries/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
When I changed it to this, all of a sudden my style started to work as expected:
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WpfTest;component/Dictionaries/Resources.xaml" />
<ResourceDictionary Source="/WpfTest;component/Dictionaries/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
0) Why does this work like this? Is it a bug or "as designed"?
1) The reason I was adding the aero.normalcolor resource dictionary was to force XP to use the aero theme. How do I force the aero look and still be able to use my own global style overrides? Can I do this and get the same results?
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component/themes/aero.normalcolor.xaml" />
<ResourceDictionary Source="/WpfTest;component/Dictionaries/Resources.xaml" />
<ResourceDictionary Source="/WpfTest;component/Dictionaries/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
Sadly, I found out that SL 3 doesn't support the FlowDocument.
I need to load a xaml file from the server into the client browser. No problem doing that using the webservice. The problem is how to display the file in a page and allow for printing.
NOTE: The xaml file is actually a simple table having 2 columns and several rows with simple text attributes
|
|
|
|
|
You can use
XamlReader.Load() .
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
We have a number of button images used in our app. As expected, management isn't sure that it's happy with the current images, so I am trying to come up with several different sets that can easily be swapped into the application. What's the best way to go about doing this? Is "use themes" the answer? If so, can someone steer me to relevant discussions/examples?
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm not sure how theming work, never did it myself.
Although this codeplex library can help perhaps?
http://wpfthemes.codeplex.com/[^]
In my case I use object template in the App resource if I want to change the look of the object.
But your case is a it different.
You don't specially want to change the look of button in general (or so it seems) but of individual button in particular...
Maybe their image content or whatever could be:
<Button Content="{StaticResource buttonFooContent}">
And then in you app resource you can define
<SomeUI x:Key="buttonFooContent" x:Shared="true" />
and you can change the content anytime in the App resource file and everyone will get it!
How about that?!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
This[^] article isn't a bad start.
"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
|
|
|
|
|
Hey all
Im new to silverlight, just want to know how to embed or add silverlight to an existing ASP.net project. In flash you only use the following code:
<object width="871px" height="400px">
<param name="aa" value="aa.swf" />
<embed src="flash\aa.swf" width="871px" height="400px"></embed>
</object>
Can someone tell me how do it with Silverlight.
Thanx
|
|
|
|
|
|
|
Hi,
I have a few vector images in XAML format that I'd like to display in my application. So far I've been able to do this using:
private XmlReader reader_;
private UIElement control_;
...
reader_ = XmlReader.Create(filename_);
control_ = (UIElement)XamlReader.Load(reader_);
Then having a Control property:
public UIElement Control
{
get
{
return control_;
}
}
And binding to this as below:
<DataTemplate DataType="{x:Type local:Tile}">
...
<Viewbox>
<Label Content="{Binding Control}" />
</Viewbox>
...
This works, but when I try and display the control in multiple controls in the same window, only one will appear. I was able to fix it by doing this:
public UIElement Control
{
get
{
XmlReader reader = XmlReader.Create(filename_);
return (UIElement)XamlReader.Load(reader);
}
}
But I'd really like to avoid parsing the XAML and reloading the control every time I use it! This is my first WPF project. Can someone recommend a better way of doing this?
Cheers!
Jack
|
|
|
|
|
I define my vector images as resources, then create controls which point to that resource for their background property, from memory.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I'm just looking into using WPF and have a simple problem.
I just want to style a treeview control, but when I add the styling to my resource dictionary, I get error :
"The attached property 'Window.Resources' is not defined on 'ResourceDictionary' or one of its base classes."
The xml is :
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Window.Resources>
<Style TargetType="{x:Type TreeViewItem}">
..........
</Style>
</Window.Resources>
</ResourceDictionary>
|
|
|
|
|
Window.Resources is needed to define a resource in your Window XAML (in the same way as UserControl.Resources is used in a UserControl, and so on). You don't need this in a resource dictionary, so you need to remove the lines
:<Window.Resources> and
</Window.Resources>
"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
|
|
|
|
|
|
vidster wrote: I have defined the resourcedictionary in the Application XAML, so it should work?
That's right. Just remember that it's an application resource, so you don't have to wrap it in a container Resources section such as a Window.Resources.
"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
|
|
|
|
|
Yes, but I'm not setting the style in the Application XAML, I just want to point it to my resource dictionary (Styles.XAML) :
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
|
|
|
|
|
I think you misunderstand me. Because you have created this in a ResourceDictionary , you don't need the Window.Resources part - that's what I mean by application resources. The way you are merging your resource dictionary in is spot on.
"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
|
|
|
|
|
Ah..ok, thanks.
i guess the tutorial I referenced is incorrect.
|
|
|
|
|
Hi,
I'm looking for good online tutorials for C# for beginners. If it matters I want to use it with WPF.
Thanks.
modified on Thursday, July 30, 2009 4:18 PM
|
|
|
|
|
You're looking for tutorials that teach you WPF ? Why don't you just buy a good book ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for the reply. Being new to programming I'm here to ask experienced programmers what is good and what isn't.
|
|
|
|