|
Hi Mark,
Is it possible to bind a StackPanel? I don't see a ItemSource or ItemTemplate attribute either...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
ItemsControl has an ItemsPanel property. Set ItemsPanel to a template
containing a StackPanel with its orientation set to Horizontal.
There's an example in the ItemsControl.ItemsPanel Property docs[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark, thanks for the reply, will give it a try
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Ok, took some googling but got it, for any n00b like me who's going to read this, here's the XAML code:
<ItemsControl ItemsSource="{Binding Path=Columns}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" >
<SNeSControls:ActiveInfonMachineColumn Width="80"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Hi
I am trying to achieve tricky binding behaviour from a treeview. I have a hierarchy of objects with the same base type. Some of these objects are of a derived 'leaf' type. I want to display the object hierarchy in a tree view with the leaf objects having a different data template from the rest of the branch objects.
The tricky thing I want to achieve is for the treeview to ignore all branches that do not have leaf objects in their subtree e.g. in this hierarhcy:
item1 - item3
_____- item4 - item6 - leaf1
__________________- leaf2
____________- item7
item3 and item7 would not be displayed as they have no leaves in their subtree.
Can this be achieved in XAML?
Thanks
Dan
|
|
|
|
|
I suggest you do that in MVVM. Here is an excellent article[^] describing how to use MVVM with a TreeView.
Eslam Afifi
|
|
|
|
|
I have taken your advice and written a view model layer which wraps my objects. However, I still have a problem:
All of the child lists of my underlying node objects are observable i.e. children can be added or removed at any time and the treeview needs to update. This means that a previously leafless node may suddenly gain a leaf in its subtree and so need to become visible. This means that I cannot simply cull leafless branches of the view model node tree - they need to be present but invisible in the tree view until a leaf is added. I have added a property 'HasLeavesInSubtree' to each tree node view model but have no idea how to use this in XAML to turn the display of these nodes on and off.
Thanks
Dan
|
|
|
|
|
Use a DataTrigger and set the visibility based on this.
"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
|
|
|
|
|
Hi ,
I added <Image> // included an image in the window.</Image>
If I wish to add a label just below the image and few other controls, how can i do it? The XAML Code is shown here.
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="Auto" Width="Auto" Loaded="Window_Loaded" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<Image
Name="imgClientPhoto"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="auto"
Height="auto"
Grid.Column="0"
Grid.Row="0"
Margin="0" Source="D:\pic1.gif" MinWidth="450" MinHeight="100" Grid.IsSharedSizeScope="True">
</Image>
<Label>
</Label>
</Window>
I added <Label></Label>just below the <Image>
but an error is seen "The property "content" is set more than once.
Please help me to correct this error.
My intention is to add an image at the top(title), then below it a label,then a dropdown box, treeview.. so on..
Please help the good way to work on this.
Thanks Ramm
|
|
|
|
|
You need to put a container into your window to handle multiple items - effectively, the content of your window is the image and you have added extra items immediately after. There are many containers available, e.g. Grid, StackPanel, UniformGrid and so on. The one you use is based on how you want to lay out your interface.
"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
|
|
|
|
|
HI ALL
I was considering and trying to Import sophisticated Designs as Xaml in a Project of WPF
I was Working with AI and also Tried MS Expression Design
==========
1) about AI
I tried to use a Plug-in to export Xaml files, but when you have complicated images it just change that image to a simple image , I had a 3D effect on my Design , but it was simplified by the plug-in i used
and just a very simple image had been made
==========
2) about Expression Design
It didn't have any Effect, the only thing that you have is Gradient, as I saw
and it is not enough to have a professional design
=============
Conclusion: I think The Xaml or at least Xaml Generator are not that powerful to produce complicated, professional designs
================
I want to tell me if it is really rigt or wrong
and if I had mistake in part 1 and/or 2 tell me if there are other tools, plug-ins , and etc
Thank you
Am I banned to write message?
Does anybody see my post?
or is there any problem that I don't get any answer?
modified on Wednesday, July 15, 2009 5:28 AM
|
|
|
|
|
cppwxwidgetsss wrote: I tried to use a Plug-in to export Xaml files, but when you have complicated images it just change that image to a simple image , I had a 3D effect on my Design , but it was simplified by the plug-in i used
and just a very simple image had been made
Expression imports AI files. You need to break them into components to create controls. It doesn't just magically create UI for you. Also, by default it creates a PNG, not XAML, and you should play with the options to create XAML as you need it.
cppwxwidgetsss wrote: It didn't have any Effect, the only thing that you have is Gradient, as I saw
and it is not enough to have a professional design
Expression creates XAML, XAML has gradients, what other effects were you hoping for ?
cppwxwidgetsss wrote: I think The Xaml or at least Xaml Generator are not that powerful to produce complicated, professional designs
A professional design should not be complicated. I've written several programs with WPF, and the UIs on them all are excellent. We had a graphic designer create designs for us in AI, and for one program I skinned with bitmaps, but nowadays I export XAML from AI files. Our designer is given total freedom, which is often a lot of work for me, in terms of non standard shapes etc, but I have NEVER had any trouble turning his screenshots into UI that is identical or better.
cppwxwidgetsss wrote: Am I banned to write message?
Does anybody see my post?
or is there any problem that I don't get any answer?
It's a free website and you posted while the USA ( where most users are ) was asleep. If I was home in Australia, you'd have got a reply. It's now 6 am and I am up early. If you want instant answers, find someone in your timezone you can pay to be on call. Otherwise, you just have to wait until someone replies.
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.
|
|
|
|
|
cppwxwidgetsss wrote: Am I banned to write message?
Unfortunately, no...
cppwxwidgetsss wrote: Does anybody see my post?
Unfortunately, yes.
BTW, set the right country in your profile. It's REAL obvious you're not from the US.
As to your question, you can do pretty much anything you can dream up with WPF. You just have to learn how, and there are no shortcuts in the learning process.
"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
|
|
|
|
|
cppwxwidgetsss wrote: Conclusion: I think The Xaml or at least Xaml Generator are not that powerful to produce complicated, professional designs
That is not correct - WPF allows you to produce extremely professional designs, perhaps it's your lack of artistic ability that's getting in the way.
"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
|
|
|
|
|
Pete O'Hanlon wrote: perhaps it's your lack of artistic ability that's getting in the way.
LOL - as I said, we have a graphic designer, if we didn't, that would sure be our main problem....
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.
|
|
|
|
|
cppwxwidgetsss wrote: I want to tell me if it is really rigt or wrong
I'm going with wrong.
XAML and XAML generators do NOT produce "complicated, professional designs"...designers do.
In fact, nothing in your post has anything to do with XAML...
You may want to try out Expression Blend 3[^], which supposedly now imports
PSD/AI files preserving the layers and allowing editing in Blend.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I wrote a class inherting from canvas. I added a child inside ItemTemplate.I am having a linkbutton as child. I added it in Page.xaml as
<my:parent><br />
<my:DataPoint Text="30 Members" Link="http://www.zsl.com" ImageUrl="../images/chat.png"></my:DataPoint><br />
</my:parent>
What i want now is,if i change the text or link value it should reflect in design view. Any Idea about this!
Gomathi R
modified on Tuesday, July 14, 2009 5:24 AM
|
|
|
|
|
Hello,
I think it would be better if you can show us some of your code. Otherwise, it's hard for us to help you to solve your problem.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
How can i partially load the controls(combo box, list box) from database, Just like the AJAX's Update panel.
Thanks in advance
|
|
|
|
|
There are numerous ways that you could achieve this, and most of them revolve around using databinding. Take a look at the MVVM pattern to get some ideas (you could start with my SongBird[^] article and look at how I bind and refresh my tabs).
"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
|
|
|
|
|
hello
i installed the silverlight exe file
when i created the project there was no silverlight file
what happened
|
|
|
|
|
I'm not sure what you are asking.
Silverlight.exe installs the Silverlight runtime. That has nothing
to do with projects.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
install Silverlight2_tools.exe
|
|
|
|
|
|
Don't tie yourself in knots trying to use XAML. Just write code to trigger the animation when you want it to run
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.
|
|
|
|