|
I wouldn't bind to a large amount of information in one go if I were you. Using virtualisation you bind to only the data you need at that time, which should make your UI much more responsive.
"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
|
|
|
|
|
I HAVE TO do it.
If it was for me I would have paged the results, but I have to load all the data from a datasource.
Thatz why I need to show a 'waiting message' while binding the data.
|
|
|
|
|
I have no problem adding an image via code if I am adding the image to the canvas of a WPF window. However I am so far unable to get the image to show if I am adding the image to a custom control that contain a canvas inside.
My setup is like this:
1) WPF Window contains a canvas: WindowCanvas
2) On the WindowCanvas, I am adding several CustomControls
3) Inside a CustomControl, I am in the XML file specifying a canvas that I give a name "ControlCanvas"
4) In the code of my application I am able to add TextBox & Ellipse etc. to an instance of the CustomControl's ControlCanvas. However, adding a Image via code to a CustomControl's ControlCanvas does not work - nothing is shown.
Image myImage;
BitmapImage myBitmap = new BitmapImage();
myBitmap.BeginInit();
myBitmap.UriSource = new Uri("Resources/Test.JPG", UriKind.Relative);
myBitmap.EndInit();
myImage = new Image();
myImage.Source = myBitmap;
myImage.Stretch = Stretch.Uniform;
myImage.Margin = new Thickness(0);
myImage.Width = 400;
myImage.Height = 266;
myImage.Visibility = Visibility.Visible;
Ellipse myEllipse = new Ellipse();
myEllipse.Width = 10;
myEllipse.Height = 20;
myEllipse.Fill = new SolidColorBrush(Colors.Red);
Custom_userControl myUserControl = new Custom_userControl();
main.TopWindow.VirtualDesktopTopCanvas.Children.Add(myUserControl);
myUserControl.myCanvas.Children.Add(myEllipse); ;
myUserControl.myCanvas.Children.Add(myImage);
|
|
|
|
|
Hi,
I created ListView with 2 column -
and i want to add item with with 2 text ( each text will be in different column )
How can i do it on the xaml ?
Thanks.
P.S: Each time i try to add by writing
<listviewitem background="#FF00D3FF" content="TextCulumn1, TextCulumn2">
I get the same text on the both column. . . .
|
|
|
|
|
Post your code. May be that would help us to understand you problem.
In a high level, it seems you are binding same property to both columns.
|
|
|
|
|
The Xaml code
<br />
<br />
<ListView.View><br />
<GridView><br />
<GridViewColumn Width="160" Header=" Header 1 " /><br />
<GridViewColumn Width="160" Header=" Header 2 " /><br />
</GridView><br />
</ListView.View><br />
<ListViewItem Background="#FF00D3FF" Content="Col1_Text, Col2_Text" ToolTip="......" /><br />
<br />
|
|
|
|
|
Guys,
Someone can please help me with this question
|
|
|
|
|
I've been playing with some data bindings recently and I've noticed sometimes I mess something up. Whatever happens prevents the application from shutting down completely. It hangs on a native call to GetMessageW() after my main window has closed.
I'm looking for any help or ideas on how to figure out where my problem might be without removing all bindings and putting them in one by one. I've also been adding my own dependency properties and am not sure if those could be causing the problem.
Brad
Deja Moo - When you feel like you've heard the same bull before.
|
|
|
|
|
You might want to take a look at this[^].
|
|
|
|
|
Thanks. I think that might help.
Brad
Deja Moo - When you feel like you've heard the same bull before.
|
|
|
|
|
You are welcome. Hope this does help you.
|
|
|
|
|
Hey all,
Can someone tell me if WPF .NET 3.5 apps are compatible on Windows CE 6.0? I tried looking at a lot of places and still haven't found a definitive answer to this. You'd think that both being Microsoft technologies it would be obviously supported but I can't seem to find a set response for the question.
Thanks,
kiranpmody
|
|
|
|
|
No they aren't. The CE framework lacks a lot (such as DirectX support) that WPF is built upon.
"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
|
|
|
|
|
thanks for the prompt reply..
|
|
|
|
|
Hi,
I'm a newbie in wpf and I have a problem with the binding.
I have a class inherited from FramworkElement and there is a Collection. The Items of this collection are inherited from DependencyObject.
On the Form is only one TextBox. I want that the text, which is typed by the user will be copied into the first Item of the collection.
Here some code
public class Item: DependencyObject
{
public string Name { get; set; }
public virtual object Value {
get { return GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
#region DependenvyProperty
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(object), typeof(Item));
#endregion
}
public class ItemContainer : FrameworkElement
{
private List<Item> _itemlist = new List<Item>();
public List<Item> ItemList
{
get { return _itemlist; }
}
}
and the form:
Window x:Class="WpfApplication2.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="417" Width="589" xmlns:my="clr-namespace:WpfApplication2">
<Grid>
<my:ItemContainer Height="18" HorizontalAlignment="Left" Margin="-168,0,0,33" x:Name="itemContainer1" VerticalAlignment="Bottom" Width="18">
<my:ItemContainer.ItemList>
<my:Item Name="Item1" Value="{Binding ElementName=txtItem1, Path=Text}" />
<my:Item Name="Item2" />
</my:ItemContainer.ItemList>
</my:ItemContainer>
<Canvas Margin="16,18,8,6" Name="canvas1">
<TextBox Canvas.Left="88" Canvas.Top="15" Height="23" Name="txtitem1" Width="89" />
<Label Canvas.Left="14" Canvas.Top="16" Height="22" Name="label1" Width="58">Item1
</Label>
</Canvas>
</Grid>
</Window>
At runtime the program displays the error2 Cannot find governing FrameworkElement or FrameworkContentElement.
I don't want to inherit item from FrameworkelElement because in the real project the class Item is inherited from another class.
What can I do to transfer the text from the textbox to the first item of the collection ?
Thanks in Advance
Willibert Stofel
|
|
|
|
|
Hi,
I currently would like to compare several test systems running WinXP and Win7 with different graphics hardware (onboard, dedicated, etc.), and therefor need some kind of WPF Benchmark application. I don't have a focus on specific WPF features at the moment, I just want to gain a general impression how each of these systems perform, i.e. how many "frames per second" they produce using different WPF GUIs.
Are there any benchmarking programs available? Which do you recommend?
Thanks alot.
modified on Monday, August 2, 2010 9:19 AM
|
|
|
|
|
Hi, All!
I'm having another major trouble. I have developed a control, that has some properties, but once I set binding to these properties, a strange error occures during the build. Visual Studio highlights an irrelevant string from the xaml code with green color.
here is a code sample which throws that error:
<a:SearchControl x:Name="SearchResult" SearchCriteria="{Binding ElementName=SearchCriteria, Path=Criteria}"/>
Note 2 things:
1) Code below builds fine
<a:SearchControl x:Name="SearchResult"/>
2) In an output window of VS, it is stated, that System.Unimplemented exception occurred in PresentationFramework.dll. Usually, such exception means, that requested method is not implemented, which is kinda odd, because this property is indeed implemented.
|
|
|
|
|
hello
I'm using sample from WPF Modal Dialog[^] to popup my WPF Modal dialog, problem is, the modal dialog is not movable, how may I correct this?
Here's code to embed the popup
<br />
<Popup<br />
Name="MyMessageModal" <br />
Placement="Top"<br />
PlacementTarget="{Binding ElementName=SomeFormElement}"<br />
Width="100px" <br />
Height="100px" <br />
IsOpen="False"<br />
StaysOpen="true" <br />
AllowsTransparency="True"<br />
Visibility="Collapsed"<br />
><br />
<StackPanel><br />
<myctrl:MyMessageDialog x:Name="SomeEmbedMsgCtrl" ></myctrl:MyMessageDialog><br />
</StackPanel><br />
</Popup><br />
And to actually show it,
<br />
MyMessageModal.IsOpen=true;<br />
MyMessageModal.Visibility = Visibility.Visible;<br />
Thanks
dev
|
|
|
|
|
You could write your own code on the mouse up, mouse down and mouse move event of the popup.
Perform lienar transforms as the user drags the mouse holding the top part of the popup.
|
|
|
|
|
Great thansk I got it working!
dev
|
|
|
|
|
I'm using VS2010 and SL4. I have the following XAML, and I'm trying to implement visual state management, but it appears I don't understand how it works.
<Border CornerRadius="8" BorderBrush="Black" BorderThickness="1" Background="SlateBlue"
Height="35" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<ItemsControl x:Name="myItems" >
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Background="Transparent"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="States">
<VisualState x:Name="MouseOver">
<Storyboard >
<ColorAnimation Storyboard.TargetName="itemBorder"
Duration="0:0:1" To="Yellow"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"/>
<ColorAnimation Storyboard.TargetName="itemContent"
Duration="0:0:1" To="Black"
Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal">
<Storyboard >
<ColorAnimation Storyboard.TargetName="itemBorder" Duration="0:0:1"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"/>
<ColorAnimation Storyboard.TargetName="itemContent" Duration="0:0:1"
Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="itemBorder" Background="Transparent" Margin="5,0,0,0">
<Border.RenderTransform>
<CompositeTransform/>
</Border.RenderTransform>
<TextBlock x:Name="itemContent" Text="{Binding}"
FontSize="13" Padding="0" Margin="5,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="White" />
</Border>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.Items>
<core:String>Item 1</core:String>
<core:String>Item 2</core:String>
<core:String>Item 3</core:String>
<core:String>Item 4</core:String>
</ItemsControl.Items>
</ItemsControl>
</Border>
.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
|
|
|
|
|
In this code, AFAIK, when you move your mouse over the ItemsControl , the background of the itemBorder (Border) changes to Yellow and itemContent (TextBox) foreground changes to Black. Both color change again when the state moves back to normal.
|
|
|
|
|
That's what I *want* to happen, but it's not happening.
.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
|
|
|
|
|
After some searching I found this[^] - apparently the datatemplate does not support the VisualStateManager . There is a workaround as given on this website.
Best of luck!
|
|
|
|
|
I have a grid defined as
<Grid x:Name="CoordWPanel" Height="38" Margin="10,0,70,10" VerticalAlignment="Bottom"
Background="#77000000" HorizontalAlignment="Left">
I want the background shade to cover the the bottom of the screen (less the margin area). But it always stops at the last control placed in the grid. The shading only goes halfway across the screen because that's how far the controls in the grid go. How can I get the grid to fill out the rest of the area in the margins?
Thanks.
Brent
|
|
|
|