strange behaviour frame in window
-
mercredi 28 juin 2006 14:10
the XAML+c# sample below, behave strange (and unwished) effect: when clicked on polygon and handler execute, main window "disappear", but application keep focus (as seen on taskbar) . Next click on app element on taskbar make focus lost by application, and next more click restore focus and window with its all content.
Anyone has some suggestion to override this behaviour (problem) ?
XAML:
<
Window x:Class="UntitledProject1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Root Window" WindowStyle="None" WindowState="Maximized" Topmost="True">
<
Canvas x:Name="scatola"><
Canvas.Triggers><
EventTrigger RoutedEvent="Ellipse.KeyUp"><
BeginStoryboard><
Storyboard x:Name="anim_attivazione"><
DoubleAnimation Storyboard.TargetName="contenuto" Storyboard.TargetProperty="Width" From="0" To="1024" Duration="0:0:5" AutoReverse="False" /><
DoubleAnimation Storyboard.TargetName="contenuto" Storyboard.TargetProperty="Height" From="0" To="768" Duration="0:0:5" AutoReverse="False" /></
Storyboard></
BeginStoryboard></
EventTrigger></
Canvas.Triggers><
Polygon Canvas.Left="100" Canvas.Top="100" Points="40,80 40,64 80,64 80,16 40,16 40,0 0,40" Fill="Blue" Stroke="Black" StrokeThickness="2" MouseDown="attiva_sx"/><
Frame x:Name="contenuto" Source="http://localhost" Canvas.Top="100" Canvas.Left="200" Width="0" Height="0" NavigationUIVisibility="Hidden" Content="Frame" Opacity="1"/></
Canvas></
Window>Code Behind:
using
System;using
System.Collections.Generic;using
System.Text;using
System.Windows;using
System.Windows.Controls;using
System.Windows.Data;using
System.Windows.Documents;using
System.Windows.Input;using
System.Windows.Media;using
System.Windows.Media.Imaging;using
System.Windows.Shapes;using
System.Windows.Media.Animation;namespace
UntitledProject1{
/// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window{
public Window1(){
InitializeComponent();
}
public void attiva_sx(object sender, EventArgs e){
Frame fr = (contenuto as Frame);fr.Source =
new Uri("http://www.microsoft.com");(anim_attivazione
as Storyboard).Begin(contenuto); //MessageBox.Show(this.WindowState.ToString());}
}
}
Toutes les réponses
-
mardi 11 juillet 2006 16:13
any suggestions about this ?
It should be enough for me (at this moment) only to know if it is a bug or it is due to my mistake (maybe combining such types of classes ?)
Alberto
-
lundi 7 août 2006 22:12
Alberto,
Are you still seeing this issue? I tried your code, and I am not seeing the issue you reported.
Thanks,
Lauren -
mardi 8 août 2006 07:36
Yes Lauren,
problem for me is still open (same effect on two different PC); but I still use June CTP SDK/run-time due to lack of Orcas add-in in July CTP.
If last runtime solve the problem is enough for me, I can wait for next complete build.
thank you
Alberto
-
vendredi 8 septembre 2006 13:16
Lauren,
now I'm using RC1 release. So I checked it again and I can confirm the problem is gone away.
Thank you very much.

