|
I want to display some stuff in a scrollable grid using WPF. Things to go in the cells are numbers, strings and icon style buttons, often with a few of these things in a single cell. Now because of the way you can embed just about anything inside anything else in WPF I'm thinking about using a grid panel inside a scroll viewer, and using something like a stackpanel in the 'cells' to hold the buttons and labels etc.
If this were GDI, I'd be thinking about using a 3rd party grid or maybe even rolling my own to do this - I'm quite comfortable in this arena, but not so sure in WPF.
So my question is what are your opinions about doing the above? The grid could have at worse about 40 rows and in an absolute extreme about 120 columns - hinting at some sort of virtualization strategy. Any suggestions gratefully received particuarly if they don't suggest buying something. Quite new to WPF still and not sure the best way to go.
Regards,
Rob Philpott.
|
|
|
|
|
If you're using WPF 4, you should already have the WPF DataGrid in your toolbox. If you're still on 3.5, install SP1 and get the WPF Toolkit from http://wpf.codeplex.com
Sure, you could roll your own if you like, but it's not necessary.
|
|
|
|
|
Thanks dude.
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
I get this error when trying to add a reference to a silverlight 4.0 app.
Is there a way to solve this problem please? See below:
Thanks
you can't add a reference to TIBCO.Rendezvous.dll as it was not built against the silverlight runtime. Silverlight projects will only work with silverlight assemblies.
|
|
|
|
|
This error is telling you that the version of the framework that you are targeting is completely different from the version this DLL was written in. In other words, there is no compatibility at any level as one uses the Silverlight assemblies and one doesn't. Now, bear in mind that you would be expecting the two frameworks to be attempting to run in the same application process space, how do you expect it to load and run two different sets of some of the same assemblies at the same time?
You can go from Silverlight to none-Silverlight assemblies, but you can't do it the other way round. I see that TIBCO have partnered with MS on Silverlight functionality, so it's entirely possible that they have a Silverlight version that you can use.
|
|
|
|
|
|
No there is no way to solve this problem - sorry.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
The library you're trying to add a reference for wasn't compiled for Silverlight. If you have the source code to the library, and if it doesn't use libaries for code that Silverlight doesn't all, you can recompile it and then link it. Otherwise, you're screwed.
.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,
Silverlight 4, Expression Blend 3
I understand template triggers in WPF are not available in Silverlight...
I used Blend to create a button template - i want the button to grow in size on the mouseover event.
I added a transition to the button in Blend and it generated the zaml...
Im assuming the latest fashion is 'VisualStateManager.VisualStateGroups' instead of triggers to do this in Silverlight...
This works fine but when the animation is complete the button resizes itself to the original size - I want the button to retain its size while the mouse is over.
Ive listed the relevant zaml below - ive tried setting storyboard properties but still the button flicks back to its original size once the animation is complete.
Does anyone know how I can retain the buttons size?
Thanks,
Chas
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused"/>
<VisualState x:Name="Unfocused"/>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="00:00:00" To="MouseOver">
<Storyboard AutoReverse="False" SpeedRatio="1">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
<EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1.654"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
<EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1.16"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
<EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver" />
<VisualState x:Name="Pressed"/>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
modified on Friday, December 17, 2010 7:35 AM
|
|
|
|
|
Ok for anyone else who experiences this...
move the storyboard out of VisualStateGroup.Transitions and into <VisualState x:Name="MouseOver" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid Margin="0,0,0,0" VerticalAlignment="Bottom">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver" >
<Storyboard AutoReverse="False" SpeedRatio="1">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
<EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1.654"/>
</DoubleAnimationUsingKeyFrames>
|
|
|
|
|
I am trying to change the border color of a WPF TextBox when it has focus. I'm doing this in code using the focus events:
private void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
_text.BorderBrush = Brushes.Red;
}
private void TextBox_LostFocus(object sender, RoutedEventArgs e)
{
_text.BorderBrush = Brushes.Blue;
}
This does not work. My googling seemed to indicate that the TextBox has built in focus behavior that could be overriding my behavior. The proposed solution was to null the "TextBox.FocusVisualStyle' property. This also did not work.
Any ideas out there?
Aaron
|
|
|
|
|
You would need to modify the control template. The border shenanigans are done in there. The ListBox, TextBox, etc. all use a "chrome border" which does all that using triggers.
|
|
|
|
|
I have try but not success
My code is
<br />
<Window x:Class="WpfApplication3.Pratice"<br />
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
Title="Pratice" Height="300" Width="300"><br />
<Window.Resources><br />
<Style TargetType="{x:Type TextBox}"><br />
<Style.Triggers><br />
<Trigger Property="IsFocused" Value="True"><br />
<Setter Property="BorderBrush" Value="Red"></Setter><br />
<Setter Property="BorderThickness" Value="4" /><br />
</Trigger><br />
</Style.Triggers><br />
</Style><br />
</Window.Resources><br />
<Grid><br />
<TextBox Name="Text1" Height="100" Width="100" BorderBrush="Pink">Hello</TextBox><br />
</Grid><br />
</Window>
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim
So Smile Please
|
|
|
|
|
In the xaml of the window, do this:
<Window.Resources>
<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsFocused" Value="False">
<Setter Property="BorderBrush" Value="Blue"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
|
|
|
|
|
This answer will upset the wpf-purists out there, but when time is money, try this:
Instead of creating a ControlTemplate-Trigger nightmare, reduce the TextBox size with Margin="1" and BorderThickness="0". THEN, place the TextBox inside of Grid tags and place a <rectangle strokethickness="1" stroke="YourColorHere"> in the Grid above TextBox. Example (with binding examples):
<Grid>
<Rectangle Stroke="{Binding CustomBorder}" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
<TextBox Text="{Binding Path=Value}" Margin="1" BorderBrush="Transparent" BorderThickness="0"/>
</Grid>
This code can be injected into a DataTemplate for a GridView or simply in a Window. Adding triggers to a simplified structure will prove easier than trying to override animations dependent on .Net version and operating system. I hate seeing my controls looking different on an XP system vs Win7, so this helps keep my projects looking clean on any display.
Duct-tape solutions aren't always that bad!
|
|
|
|
|
I am using a WCF project in my silverlight 4 project.
At present I have a few settings inside the web.config file of the WCF project which I read from a service file inside the wcf project.
After deployment of this silverlight application, will I be able to see this web.config (Which is inside the wcf project) file and manually update it with new settings so that I do not have to recompile and redeploy each time?
What I mean is:
I know that the web.config file in the web host project can be modified after deployment and there is no need to redploy, etc.
The question is can I make changes in the web.config file which is inside the wcf project without any redeployment? will the service be able to read the new settings in the web.config after it has been manually changed?
Is it possible to manually browse to the wcf web.config file and modify it?
Thanks
|
|
|
|
|
You should be able to edit it, because I have done that before. What you might have to do is to restart the website that the service is running on to make sure that it gets the new settings.
Steve Maier
|
|
|
|
|
Hi arkiboys,
You can change the content of the web.config whatever way you want, provided you have the correct access rights for that.
In order for IIS to take care of the changes, just type iisreset at a command prompt on your web server, and it will reload its configuration.
Hope this helps. Kind regards.
|
|
|
|
|
How do I make my silverlight 4 application (The solution includes silverlight page, wcf project) so that someone in the office can access it?
Thanks
|
|
|
|
|
By deploying it to an IIS server that they can get access to, and properly configuring it.
|
|
|
|
|
Do you want to share your Project with other Programmers ? want to share the source ?
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 created a silverlight 4.0 in vs 2010 application as follows:
1-The solution contains the the usual web project for hosting the silverlight app.
2- The solutions also contains a WCF project and the silverilght project with the silverlight pages and the service references to the WCF.
How do I make this so that others can access it please?
Thanks
|
|
|
|
|
You now need to host this application on a web server.
Users can then access this application via the url of the server plus your application.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
You've asked an awful lot of fairly basic questions. Can I suggest that you buy a good book on Silverlight development which will save you an awful lot of effort. I like Silverlight 4 Unleashed[^] and think it would help you immensely.
|
|
|
|
|