|
Would a UniformGrid work for you there?
|
|
|
|
|
I just read something about this, will see if it works, thx!
/does exactly the same as a normal grid..
Example of what im doing:
<br />
<br />
<grid><br />
<br />
<expander content="{Staticresource somecontent}" /><br />
<Expander content="{Staticresource somecontent2}" /><br />
<Expander content="{Staticresource somecontent3}" /><br />
<Expander content="{Staticresource somecontent4}"/><br />
<br />
</grid><br />
The resource content is something like this:
<br />
<image /><br />
<image /><br />
<image /><br />
...<br />
<image /><br />
Each expander resizes now to the amount of content (images) in them, which is different for each 1..
Found a solution:
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid}, AncestorLevel=2}, Path=ColumnDefinitions[0].Width}" />
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid}, AncestorLevel=2}, Path=ColumnDefinitions[1].Width}"/>
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid}, AncestorLevel=2}, Path=ColumnDefinitions[2].Width}"/>
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid}, AncestorLevel=2}, Path=ColumnDefinitions[3].Width}"/>
</Grid.ColumnDefinitions>
modified on Friday, April 11, 2008 3:48 AM
|
|
|
|
|
|
Michael,
Thanks for this post.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
|
thanks. I saw your post in Silverlight forum.. I will add your link in my post too.
|
|
|
|
|
Thanks!
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi All,
I'm just doing some work in DirectX and have a referencing question. Using this method on a device needs a handle to the main apps window the problem with that was my directX layer was referenced by the presentation layer so to actually set this to my apps mainwindow class i've had to reference the presentation layer from the audiolayer ...
Does it actually make sense to reference this way around or is there a better solution to this issue?
This is a WPF window and unlike WinFOrms (as far as I can tell) this isn't showing me a Handle property to specify, any advice on that would be great.
EDIT -
Have been doing a bit more digging at it seems that my fix is the way to go. Since WPF windows are essentially DirectX setting the SetCooperativeLevel to System.IntPtr.Zero is the way to go ...
Has anyone else done any DirectX work with WPF yet?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
As I understand it, WPF is basically a DirectX wrapper for .NET. I don't believe that native DirectX can be combined with WPF Direct X and have them cooperate with each other. Good luck either way.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi Thomans,
The working example I have here at the moment is using this code:
public static void PlayAudioFile(string _fileName)
{
DevicesCollection soundcards = new DevicesCollection();
Device dSound = new Device();
WindowInteropHelper wih = new WindowInteropHelper(Application.Current.MainWindow);
dSound.SetCooperativeLevel(wih.Handle , CooperativeLevel.Priority);
BufferDescription d = new BufferDescription();
Although that said I think I need to place all this audio in its own thread as there are currently some audio hiccups happening. Sometimes an audio file will play through fine other times it plays a short burst and then stops so this isn't fully functioning code yet.
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
is there any reference of building a datagrid in wpf from scratch?
by data grid i mean the following example requirments:
DataBinding,
sorting,
filtering,
drag&drop,
column add+remove, order
row\column selection\click
tooltips
diferent cells styles with diferent control
...
i mean a whoooooole Data Grid View wpf style - (i.e DevEx's XtraGrid)
any thoughts?
thanks,
yanai
modified on Sunday, March 30, 2008 10:41 AM
|
|
|
|
|
I suppose you could always buy the source to somebody else's implementation, or (and here's a thought) you could figure out how to implement it for yourself. It would be a great journey for you (and if you start small and basic it shouldn't be beyond you) and you will have the pleasure of becoming a WPF master as a result.
Good luck.
|
|
|
|
|
Well you know, I'm curious about this too. Looking around the net shows that people are asking a lot about grid controls in WPF, and all links seem to point to XCeed's offering.
But a lot of what you read about WPF tells you that its not always necessary to create a new control to get what you want. You can combine and customise them all to get what you're after. In Windows Forms you'd buy or build but it doesn't seem so clear cut with WPF.
I built a GDI+ grid recently when the place I work refused to buy one, simple but effective and no problem because I can remember Petzold first time round, but being new to WPF I'm somewhat stumped as well.
What would you do Pete if you had to display tabular data in WPF, buy a control or go about building one?
Regards,
Rob Philpott.
|
|
|
|
|
Thinking about it ... a really quick dirty way might be to use nested stack panels and borders ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Rob Philpott wrote: What would you do Pete if you had to display tabular data in WPF, buy a control or go about building one?
It depends on what I was trying to do with it. If it wasn't too complicated then I'd look at extending the ListView - the beauty of templates is that you can turn something like the listview into a grid control without too much effort. Mind you, I do use Xceed WPF Grid as well - it's very nice (and free too in the basic version, always a plus point with me).
|
|
|
|
|
Greetings,
Are there any charting/graphing providers for WPF (i.e. like Dundas Charts)?
Thank you.
BP
|
|
|
|
|
Yes ... I'm currently using Infragistics ... althought we have two new ones on the market now as well.
ComponentOne have just released their WPF stuff and Xceed have their WPF stuff out too. ChartFX also have a WPF component but its still in beta and has been for what seems like years.
I have only worked a lot with the Infragistics solution which works well. Good support too. Interestingly I have also spoken to Nevron a lot ... they seem to be almost shunning WPF in favour of actually writing a graphics engine of their own in order to then display that in a hosted fashion within WPF as they seem to think that WPF doesn't have the performance capability.
I'm using the Infragistics datagrid with 60,000+ rows bound to it with no problems. Check them all out on these links ...
http://www.infragistics.com/[^]
http://www.softwarefx.co.uk[^]
http://xceed.com/Grid_WPF_Intro.html[^]
http://www.componentone.co.uk[^]
http://www.nevron.com/Nevron.Home.aspx[^]
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi Experts,
I want to start my hands on Silverlights. can any one suggest me that how can i start ?
Thanks in Advance !!!!
Good day
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
|
|
Hi Michael
Thanks for input !!!! I am very new in Silverlights. That will help me lot !!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
A couple of follow-on questions to this thread...
Michael Sync wrote: There are three majors versions such as Silverlight 1.0, Silverlight 2.0 (1.1) Alpha and Silverlight 2 (not 2.0) beta1 in Silverlight. If you are new to Silverlight, I suggest you to start with Silverlight 2 beta1.
What are the compelling reasons to start with Silverlight 2 beta 1 versus 1.0 or 1.1?
Michael Sync wrote: You need to install VS 2008 and SL 2 Tool for VS 2008 (it includes all required softwares (runtime, hotfix for VS, SDK))[^]
Is there any reason to need Expression Studio or Blend in order to do Silverlight 2 development?
Thanks in advance for any advice/guidance...
Cheers,
Carl
|
|
|
|
|
Hi all,
i try to create a style for a menu/menuitems (changing background, fonts and so forth...). Everything works well except the background of the separators. Has anyone an idea where to specify that the background is not the windows default gray but the brush i define?
thanks Rainer
|
|
|
|
|
Take a look at the separator control template. I left the default control tempate in place without modifying it.
You'll notice that although the Separartor has various public properties exposed, the template does not consume them. This is why your attempts to change it didn't work.
So you can take this simple XAML and play around witht control template to get the look you desire.
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Window1"
x:Name="Window"
Title="Window1"
Width="640" Height="480">
<Window.Resources>
<Style x:Key="SeparatorStyle1" TargetType="{x:Type Separator}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Grid Margin="0,6,0,4" SnapsToDevicePixels="true">
<Rectangle Margin="30,0,1,1" Height="1" Fill="#E0E0E0"/>
<Rectangle Margin="30,1,1,0" Height="1" Fill="White"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid x:Name="LayoutRoot">
<Menu HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" Height="Auto">
<MenuItem Header="File">
<MenuItem Header="New"/>
<Separator Style="{StaticResource SeparatorStyle1}"/>
<MenuItem Header="Exit"/>
</MenuItem>
</Menu>
</Grid>
</Window>
modified 27-Feb-21 21:01pm.
|
|
|
|
|
I have WPF application that performs scrolling of three xaml controls in circular manner.
If I use simple control without much styles or instead use a simple image in the element, then scrolling goes fine and application performance is good.
However, if I load the control with heavy WPF styles,then at very high resolution say (1400 * 900) systems, scrolling gets jerky and CPU usage increases.The problem exists with machines with low graphic card.
I studied this and found that WPF can take advantage of hardware rendering pipeline but couldn't find any working example.
Is there some way in WPF by which we can use heavy styled xaml controls with good performance on PCs with UMA graphic card?
|
|
|
|