Advanced Forum Search Results
-
Hi,
Canvas class has a static method named Canvas.GetLeft(UIElement element);
You can try this:
currentPosition = Canvas.GetLeft(i3);
The return value is of type double, so that you can use it directly.
Regards!
-
Hi,
I think you should change From and To property of the animation everytime when you want to move something forward.
And also you should set the AutoReverse property as false, and don't call stop method, just wait the animation completed itself.
Regards!
-
Hi,
I think you should do the "to maintain a list of all open childwindows" that you don't prefer to.
Because in fact ChildWindow is something on a popup. You konw that when a popup doesn't have parent, we cannot find it in visual tree beginning with Application.Current.RootVisual. So if we don't have the popup reference ...
-
Hi,
the problem that your image doesn't be loaded is that you don't add it to the visual tree.
The RootVisual is a new MainPage instance, however, you create a canvas, a grid, and an image, no matter how you do with them, the visual tree just contains the MainPage instance, but not your elements.
So if you want to see your image, ...
-
Hi,
I don't think loading stream from xaml to create style for custom control is a good idea, there is a more simple way.
You can create a folder named "themes" and add a xaml file named "generic.xaml" to that folder. Then just define the default style for your own custom control, at code behind, adding this line of code ...
-
Hi,
your MediaPlayer is a direct subclass of Object but not UIElement, so that you cannot add it as a child of Grid.
In xaml, if you write:
<Grid x:Name="LayoutRoot">
<VideoPlayer:MediaPlayer/>
</Grid>
It will be as same as writing these code at code behind:
Grid LayoutRoot = new ...
-
Hi,
please use Storyboard.TargetName instead. The Storyboard.Target should be an object instance, so that we cannot set it as an x:Name xaml element, just Stoaryboard.TargetName is OK.
Regards!
-
Yes, there is only one Tooltip, however, when should you show this tooltip?
I think the tooltip will show when you move mouse on your picture, and when you move out, you should hide it, and if you stay your mouse for some seconds -- maybe about 5 seconds or so, you should hide it too.
So I think you should add handler for your Image's ...
-
Hi,
the TooltipService has a Placement property, you can set it as Mouse, then the tooltip will dispaly just at the position of your mouse. However, if you move the mouse, the tooltip will not follow the cursor. If you want this Tooltip moves with cursor too, I think you should create your own control class to do it, it will be very complex ...
-
Hi,
once you call UpdateLayout method, this method runs in main UI-Thread, however, some work doesn't be done at once, you konw there is a worker thread with highest priority to do some background work.
So, when you want to do something after those work is done, please use Dispatcher.BeginInvoke method, the delegate invoked will be call ...