|
How to change the propertymetadata options to make it work? Strange thing is if the window is resized or the control is resized manually from the window shown, the user control holding all items control displays properly.
I tried UpdateLayout on the main usercontrol, constituent user controls and also refresh on the windows form that hosting the main control, but no use!
How do I force a updatelayout on the wpf user control? UpdateLayout, InvalidateArrange, InvalidateVisual...nothing seems to work.
|
|
|
|
|
Well, I found the bug. ItemControls were inside a 3rd party actipro navigation pane control. Once I removed the pane control and displayed the itemscontrol in a simple grid, voila, it worked.
Thanks for all the inputs. I'll escalate to Actipro Software. But learnt a lot on wpf layout though!
|
|
|
|
|
I was thinking about making a scaled down spreadsheet like on google docs but with silverlight. Anybody else try something similar to this yet?
Mine is only going to do simple math and have text and maybe span columns a-f and rows 1-50.
Right now the idea is to store the formulas in a separate database table from the values, and i'm going to use grammar like <math> and <text> for to denote what each cell does.
If anybody has any comments, it would be greatly appreciated.
thanks.
|
|
|
|
|
Hi all!
Could you please help me with my problem. I am writing an app that allows users to drag controls over a canvas and have met the following strange behaviour: wpf performance slowsdowns as soon as a button on a form receives focus. This is so strange to me. I've posted a code of a sample app, please try to click on a red rectangle, and move the mouse holding left button. You should see that rectangle follows the cursor pretty fast. But if you click (or even press Tab to give the button a focus) and try to drag the rectangle again - you will see that now rectangle is not as fast as before.. The recrangle will be still slow if you click Tab again and give focus to the textbox.
Do you know why it happens and how I can avoid it?
<Window x:Class="ButtonSpeedTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="627" Width="580">
<Canvas Background="Wheat" MouseMove="MyMouseMove">
<Button Canvas.Left="30" Canvas.Top="30" Height="37" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="66">Button</Button>
<Rectangle MouseDown="MyMouseDown" MouseUp="MyMouseUp" MouseMove="MyMouseMove" Name="rect" Canvas.Left="100" Canvas.Top="100" Fill="Red" Stroke="Black" Width="70" Height="50" />
<TextBox Canvas.Left="246" Canvas.Top="37.52" Height="23" Name="textBox1" Width="120" />
</Canvas>
</Window>
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace ButtonSpeedTest
{
public partial class Window1 : Window
{
bool isDragging;
public Window1()
{
InitializeComponent();
}
private void MyMouseDown(object sender, MouseButtonEventArgs e)
{
isDragging = true;
}
private void MyMouseUp(object sender, MouseButtonEventArgs e)
{
isDragging = false;
}
private void MyMouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
Point position = e.GetPosition(this);
rect.SetValue(Canvas.LeftProperty, position.X - rect.Width / 2);
rect.SetValue(Canvas.TopProperty, position.Y - rect.Height / 4);
}
}
}
}
Thanks,
Sergey.
|
|
|
|
|
Just a guess - The animated background, at least on the default Vista
theme, may be slowing things down *shrug*
FWIW - I played around with your code-behind a bit. Here's what I was using
(changes marked in red):
bool isDragging;
private void MyMouseDown(object sender, MouseButtonEventArgs e)
{
<code>Mouse.Capture(rect);</code>
isDragging = true;
}
private void MyMouseUp(object sender, MouseButtonEventArgs e)
{
<code>if (isDragging)
{
Mouse.Capture(null);</code>
isDragging = false;
<code>}</code>
}
private void MyMouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
Point position = e.GetPosition(<code>canvas</code>);
rect.SetValue(Canvas.LeftProperty, position.X - rect.Width / 2);
rect.SetValue(Canvas.TopProperty, position.Y - rect.Height / 4);
<code>e.Handled = true;</code>
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Thanks for your reply.
You are right about Vista themes. I've noticed that this effect can be seen only on Vista with enabled Aero.. If Aero is disabled - everything works perfectly.
However with Aero turned on - I see performance decrease even with your corrections to my code.
Thanks,
Sergey.
|
|
|
|
|
In addition to Jammer's suggestion...
You can always use your own button template instead of the default
themed button template.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I've noticed that if you have a window with "Allows Transparency" set to true and then an animation that manipulates a UIElement Opacity setting things can get really juddery/slow ...
This maybe your problem ...
I really noticed it using an Infragistics Chart control and a popup window in one of my projects.
The chart is animatable and the colours used in the chart are also slightly transparent.
If I set the AllowsTransparency="True" the animation ran like a dog ... turn it off and all is well.
Defo worth looking into.
|
|
|
|
|
Hi all,
i'm trying to find out how print in WPF...
My purpose is print a report(bill,price list,etc etc..) that i create but i don't know how print.
if you have any idea,advice or link i will thanks you in anticipate .
Have a nice day.
Best Regards,
Bye
|
|
|
|
|
A simple google search for "WPF print" returned 1,080,000 results.
I believe there must be something out there to help you...
|
|
|
|
|
You have to create an Xps document in memory in order to print it.
|
|
|
|
|
One way that I have used: FlowDocumentReader pages. The reader has a simple print method, and the pages can be designed hierarchical and can use WPF controls.
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 Blog
|
|
|
|
|
Hi All,
We just getting to the point of running some demo's of an application we've built and we're having a few performance problems running the app on a handful of these laptops:
http://www.dell.com/tablet?s=biz&cs=555[^]
Unfortunately we've bought 4 of them ... anyway ...
The app runs fine on every other machine we've tried it on, I've also tested my own WPF app on these laptops and that performs equally poorly.
Does anyone have any ideas on what could be causing this drop in performance? Could it be related to the touchscreen?
The main grid control in use in both apps is the XamDataGrid from Infragistics.
I'm just wondering if there is a load of extra user input stuff going on due to the touchscreen that maybe slowing the grid down?
Any ideas would be great.
Thanks,
|
|
|
|
|
Hello
Iam trying to run a WPF application, but no data is dsplayed in the Grid.
The relevant codebehind file is as under Window1.xaml.vb
Private Sub BindData()
Dim conn As SqlConnection = New SqlConnection
Dim command As SqlCommand
Dim dataadp As SqlDataAdapter = New SqlDataAdapter
Dim dtTbl As Data123DataSet = New Data123DataSet
Dim query As String = "SELECT EntityCode, Title, Name FROM dbo.Entity"
Dim connstring As String = "Data Source=SRITANU;Initial Catalog=Data123;User ID=sa"
conn = New SqlConnection(connstring)
Try
command = New SqlCommand(query, conn)
conn.Open()
dataadp.SelectCommand = command
dataadp.Fill(dtTbl, "Entity")
DataContext = dtTbl
Catch ex As Exception
conn.Close()
End Try
End Sub
The XAML code is as under Window1.xaml :
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="670" xmlns:c1grid="http://schemas.componentone.com/wpf/C1DataGrid" WindowState="Maximized">
<Grid Width="574">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="574*" />
<ColumnDefinition Width="0*" />
</Grid.ColumnDefinitions>
<c1grid:C1DataGrid Margin="0,12,0,21" DataContext="{Binding dtTbl}" Name="C1DataGrid1" ItemsSource="{Binding Path=Data123DataSet.dtTbl, ElementName= Window, Mode=Default}">
<c1grid:C1DataGrid.Columns>
<c1grid:Column Caption="CUSTID" ColumnName="EntityCode" PropertyName="EntityCode " />
<c1grid:Column Caption="TITLE" ColumnName="Title" PropertyName=" Title"/>
<c1grid:Column Caption="NAME" ColumnName="Name" PropertyName=" Name"/>
</c1grid:C1DataGrid.Columns>
</c1grid:C1DataGrid>
</Grid>
</Window>
Please point out my mistake. Iam quite befuddled
Best Wishes ....... ARIJIT
|
|
|
|
|
It looks like you've set the DataContext for the window to dtTbl so
you should just need to do something like this:
<c1grid:C1DataGrid Margin="0,12,0,21" Name="C1DataGrid1" <code>ItemsSource="{Binding}"</code>>
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I made the changes and it worked.
THANKS !
Best Wishes ....... ARIJIT
|
|
|
|
|
I made the changes and it worked.
THANKS !
Best Wishes ....... ARIJIT
|
|
|
|
|
You're welcome!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I add a expander to a window and the double animation when is expanded. However, the to property of the doubleanimation is hardcoded, in my example, the "to" property is 200 and 400. I want to ask that how could it binding to the actual width or height of the expander control? Is this possible?
<Expander Grid.Column="3" Grid.RowSpan="2" Header="expander1" Margin="3,12,-83,18" Name="expander1" BorderBrush="Red" BorderThickness="2" Width="200" Height="400">
<StackPanel>
<Button Width="100">This is the button one</Button>
<Button Width="100">This is the button two</Button>
</StackPanel>
<Expander.Triggers>
<EventTrigger RoutedEvent="Expander.Expanded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="expander1" Storyboard.TargetProperty="Width"
From="0" To="200" Duration="0:0:0.25" />
<DoubleAnimation Storyboard.TargetName="expander1" Storyboard.TargetProperty="Height"
From="0" To="400" Duration="0:0:0.25" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Expander.Triggers>
</Expander>
thanks.
|
|
|
|
|
You could always replace this with To="{Binding ElementName=expander1, Path=ActualWidth}"
|
|
|
|
|
I tried that. It works. Thanks a lot.
Eric
|
|
|
|
|
You're welcome. I'm glad to help - and a 5 for the thanks.
|
|
|
|
|
hi all,
i am using VS2005 With frame work 3.0 and insatlled the SCSF 2007 release . i want to know this release supports the wpf in winfroms.please help me in this. i am trying from past one day.
Thanks ,
Guru
modified on Wednesday, December 17, 2008 5:07 AM
|
|
|
|
|
Powerful reporting system plus advanced technology is your business success!
Report Sharp-Shooter for Silverlight is a flexible and reliable tool designed to create reports based of any .Net data sources. The support for Silverlight technology provides unquestionable advantages for both users and developers. Developers can create functional Web reports that have functionality of traditional desktop reports. Users, in their turn, will be able to get reports just opening their browser from anywhere. Thus, you get two constituents of your business success.
New possibilities to make your work more effective and easy!
Report Sharp-Shooter for Silverlight Beta is the next step toward the final release of the product. This version provides more freedom in managing all aspects of report viewer work from code. Now the developers have access to product object model and can change page display mode, zoom in and zoom out, manage navigation, etc.
Company specialists also took care about users. They decreased the amount of data propagated via the network up to three times and let clients considerably reduce traffic and save time.
There is also no need to re-render the pages acquired earlier. These pages are cashed on the server side. XPS and RTF export filters are available in this new version.
Embed and deploy Report Sharp-Shooter for Silverlight in your application today!
A Go Live License will allow you to immediately deploy Report Sharp-Shooter for Silverlight while the product is still in beta and the last details are ironed out before release. The purchase of any Go Live Licenses will later be exchanged for an equivalent license of the final release version.
Moreover, now you can save on purchasing licenses of this powerful Silverlight reporting tool. Perpetuum Software offers 30% discount to those developers who purchase licenses while the product is at Beta stage.
Report Sharp-Shooter for Silverlight Beta is the first report generator for Silverlight capable of making developers work more enjoyable and providing users with flexible and powerful reports of the highest quality.
Feel free to visit the official webpage of the product at http://www.perpetuumsoft.com/Product.aspx?lang=en&pid=102
or feel free to download demoversion at http://www.perpetuumsoft.com/Demo/slviewer/default.aspx
|
|
|
|
|
hello
creating a website in xaml with silverlight website which allows user to register,the registration confirmation details will be provided to client in the form of email,the email will be send to email id and at the same time it will go to webmaster submitted by client at the time of registration and one thing registration details will be save in database
|
|
|
|