|
syed tameem wrote: I thought to use listview but i didnt get a tree like structure.
What about a TreeView?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I want to not localize all
items in xaml window
but
when i use msbuild /t:updateuid
all items will have x:uid and this
make the window code very bad i want
to put x:uid for just some items but
i got error can we disable localization
for some items in other way ?
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
Why not use the localisation techniques described in this[^] article?
|
|
|
|
|
hi,
The scrolling functionality offered by WPF ScrollViewer is only avialable at runtime. Is there a way so that I can
get the design time scrolling facility. So that I can scroll and see the controls in the container window. Can Customizing the control provide the desired design time scrolling facility. Is there any way I can get design time scrolling facility?
XAML code:
<ScrollViewer Margin="3,3,3,3" ScrollChanged="ScrollViewer_ScrollChanged">
<Grid Margin="3">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Button Margin="58,32,122,9" Height="100" Name="button1">Button</Button>
<Button Grid.Row="1" Height="100" Margin="102,21,78,20" Name="button2">Button</Button>
<Button Grid.Row="2" Margin="81,22,99,19" Height="100" Name="button3">Button</Button>
<Button Grid.Row="3" Margin="81,16,99,25" Height="100" Name="button4">Button</Button>
</Grid>
</ScrollViewer>
modified on Sunday, January 11, 2009 12:59 PM
|
|
|
|
|
I am wanting to create my own custom tooltip that I have control over. Basically, I want to tooltip how soon it comes up and how long it stays up as long as over the control. I know that in .NET 3.5 they finally added the TooltipService that allows you this control, but still using .NET 3.0. On my controls of interest, I was taking over the MouseEnter and MouseLeave and then attempting to open a Tooltip or Popup. StaysOpen is false, and I set the IsOpen=true to show.
I have tried using both Tooltip and Popup controls and have similar problem. Problem is that when I set the IsOpen=true on the tooltip/popup, that they take over the mouse capture. My original control gets the MouseLeave event and the TT/popup gets the MouseEnter. If I move my mouse over another control, I would like these to close, but since the TT/popup has taken over mouse capture, then nothing I can do bug re-click again back on the main window.
I would like to emulate how the current WPF tooltip works, or extend it if possible. i.e.g it pops up but does not affect the mouse capture, other controls on the form still get MouseEnter/Leave events.
|
|
|
|
|
Well, after some more research I found out that the TooltipService is available under 3.0, so this solves most of my problems. Though, it seems that the ToolTipService.BetweenShowDelay doesn't do what I really expected. I have tooltips for items in a listbox that does require some time to retrieve. One issue that I was having is that when moving the mouse down over items, it would try to retrieve the tooltips for almost each row in the list as I was just moving the mouse down. I set the BetweenShowDelay to 0 to try to force the tooltip to always use my InitialShowDelay, but this doesn't seem to work.
I think I am mostly ok now, I am able to have some more control over the tooltips.
|
|
|
|
|
Im trying to write a image from a database to the hard drive and then read it back to the Image Control.
Im getting the error: The process could not access .........\temp.jpg because it is being used by another process
I have a the same app in Winforms and there its simple just put Picturebox.Image.Dispose before you attempt to write over the old file. But in WPF it won't work. I have spent hours trying to figure this out, tried to dispose a lot of resources and Google. But could not find anything.
I don't want to read the picture to the memory because it uses a lot of it.
If someone could help me it would be appreciated, Thanks
my code is
if (imageStorage.Source != null)
{
imageStorage.Source = null;
}
FileStream FS1 = new FileStream("temp.jpg", FileMode.Create);
byte[] buff = (byte[])dRow[1];
FS1.Write(buff, 0, buff.Length);
FS1.Close();
FS1.Dispose();
BitmapImage image = new BitmapImage();
image.BeginInit();
image.UriSource = new Uri(Directory.GetCurrentDirectory() + "\\temp.jpg");
image.DecodePixelWidth = 200;
image.EndInit();
imageimageStorage.Source = image;
|
|
|
|
|
Instead of writing the data to a disk file which gets locked, why not just feed the stream directly to the image.
I Googled the below code snippet, should get you going.
BitmapImage NI = new BitmapImage();<br />
Stream ImageStream = new MemoryStream(byteArray);<br />
NI.StreamSource = ImageStream;
modified 27-Feb-21 21:01pm.
|
|
|
|
|
"I don't want to read the picture to the memory because it uses a lot of it."
modified on Saturday, January 10, 2009 9:27 PM
|
|
|
|
|
What does writing the file to disk get you? Is there are requirement to do this?
Is there a reason to persist the image from the database to the disk, then read disk and load into Image?
After you read the image from the database, it is in memory. That's why is suggested that solution.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Well I have a reason: the images loaded into the memory uses a lot of memory.
reason here is the same to save memory. Its better to write the single file to the disk and keep overwriting it until the user closes the application. Then it will be deleted
|
|
|
|
|
When you set the Image.ImageSource to your file, you are reading it into memory. You can read it directly into your image instead (and overwrite as needed). All writing it to a file before loading it into your image does is create the additional overhead of the File I/O operations.
Hope this helps,
Keith
|
|
|
|
|
How im I reading it into the memory in my code?
The big problem is that If I set imageStorage.Source = null; the source is null but the picture still has a height and width which means the its still in the Image Control?? thats the strangest part. I think if someone would suggest a solution here, it would work.
Allonii
|
|
|
|
|
You are reading the picture into memory when you set the image source equal to the file. If the program is going to display the image, it MUST read the image into memory at some point and WILL keep it in memory for at least the duration of the time it is being shown.
|
|
|
|
|
yes, I'm aware of that but its then referring to the file and by that reduce the memory usage.
I tried to write 10 pictures to the hard drive and read from them and compered the same application but instead reading from a memory stream. Well the app reading from the files used 30-50 % less memory.
That's why I don't see anything positive with reading pictures directly from a memory stream
|
|
|
|
|
Im new in the WPF issues.
I create some WPF object - this object is some square that need to be in some size.
In run time i need to pass somehow the size of the square and i dont know how to do it.
thanks for any help.
|
|
|
|
|
Please post your XAML code
|
|
|
|
|
Yanshof wrote: I create some WPF object - this object is some square
It would really make it easier to help if you specify the class of the "some WPF object".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
SomeWpfObject , it implements ISomeWpfObject .
|
|
|
|
|
I need to read the docs more closely
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
if your squar is any UIElement or a rectangle try this
Rectangle myrect = new Rectangle;
myrect.width = 10;
myrect.height = 10;
myrect.Margin = new Thickness(100,100,0,0);
|
|
|
|
|
if I created a silverlight menu using expression blend, what do I need to do exactly in order to add to my asp.net 2.0 web application?
I know that silverlight needs framerwork 3.0 or 3.5. But my web applcation is built on framework 2.0 so how can I convert it so that I could use the silverlight control?
I need steps please..
thanks in advance
|
|
|
|
|
|
I have a problem with ValidationRules. Basically the data binding works, but the Validate-method of the ValidationRules never fire.
This is part of my XAML (ZoomDialogBox.xaml):
<StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
<Label>Factor:</Label>
<TextBox Name="FactorTextBox" Width="30" Margin="10,0,0,0">
<TextBox.Text>
<Binding Path="." UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<validators:ZoomFactorValidationRule MinZoomFactor="1" MaxZoomFactor="20" />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</StackPanel>
This is the property I am binding to, and this binding works (from ZoomDialogBox.cs):
public int ZoomFactor
{
get
{
return (int) this.DataContext;
}
set
{
this.DataContext = value;
}
}
As said, the binding works, but the ValidationRules is never applied. What am I doing wrong here?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|