提出问题提出问题
 

问题is this bug?

  • 2009年6月28日 20:06ORover 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    I have following user control:

    <

     

    UserControl x:Class="VDownloader.VideoElement"

     

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

     

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

     

    Height="105" MouseDoubleClick="UserControl_MouseDoubleClick" MouseUp="UserControl_MouseUp">

     

     

    <UserControl.Resources>

     

     

    <ControlTemplate x:Key="DownloadButton" TargetType="{x:Type Button}">

     

     

    <Button x:Name="MyButton" Height="30" Width="30" VerticalAlignment="Bottom" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">

     

     

    <Image Source="/VDownloader;component/icons/download.png" Width="18" Height="18"></Image>

     

     

    </Button>

     

     

    <ControlTemplate.Triggers>

     

     

    <Trigger Property="IsMouseOver" Value="True">

     

     

    <Setter TargetName="MyButton" Property="Cursor" Value="Hand"></Setter>

     

     

    </Trigger>

     

     

    </ControlTemplate.Triggers>

     

     

    </ControlTemplate>

     

     

    <ControlTemplate x:Key="PlayButton" TargetType="{x:Type Button}">

     

     

    <Button x:Name="MyButton" Width="80" Height="30" Background="Transparent" HorizontalAlignment="Left" VerticalAlignment="Bottom" BorderBrush="Transparent">

     

     

    <Border BorderThickness="1" Background="Transparent" CornerRadius="1" BorderBrush="Gray">

     

     

    <StackPanel Orientation="Horizontal" Margin="1">

     

     

    <TextBlock Text=" Play now " VerticalAlignment="Center"></TextBlock>

     

     

    <Image Source="/VDownloader;component/icons/media_play.png" Width="19" Height="19" />

     

     

    </StackPanel>

     

     

    </Border>

     

     

    </Button>

     

     

    <ControlTemplate.Triggers>

     

     

    <Trigger Property="IsMouseOver" Value="True">

     

     

    <Setter TargetName="MyButton" Property="Cursor" Value="Hand"></Setter>

     

     

    </Trigger>

     

     

    </ControlTemplate.Triggers>

     

     

    </ControlTemplate>

     

     

    </UserControl.Resources>

     

     

    <Border Name="borderMain" BorderThickness="0" BorderBrush="DodgerBlue" Margin="2">

     

     

    <Grid>

     

     

    <Image Margin="107,7,77,0" Width="20" Height="20" Name="imgType" VerticalAlignment="Top" HorizontalAlignment="Left"></Image>

     

     

    <TextBlock Margin="130,7,77,0" Name="textVideoName" Height="23" VerticalAlignment="Top" Foreground="Blue" FontSize="12"></TextBlock>

     

     

    <TextBlock Margin="107,34,12,37" Name="textVideoDescr" TextWrapping="Wrap" />

     

     

    <!--<TextBlock Margin="107,54,12,37" Name="textTemp" TextWrapping="Wrap" />-->

     

     

    <Border BorderThickness="2" Margin="7,7,0,5" Width="94" BorderBrush="Blue" HorizontalAlignment="Left">

     

     

    <Image Name="image1" Stretch="Fill" />

     

     

    </Border>

     

     

    <StackPanel Orientation="Horizontal" Margin="107,63,0,5" >

     

     

    <Button Click="Button_Click" Name="btnDownload" Template="{StaticResource DownloadButton}" >

     

     

     

     

    </Button>

     

     

    <TextBlock Text=" "></TextBlock>

     

     

    <Button Name="btnBrowserGo" Click="btnBrowserGo_Click" Template="{StaticResource PlayButton}">

     

     

     

     

    </Button>

     

     

    </StackPanel>

     

     

    </Grid>

     

     

    </Border>

    </

     

    UserControl>

     

     



    draw attention MouseUp="UserControl_MouseUp" (select this element)

     

     


    this works fine in following areas (green) and does not work in red:

    http://www.magicscreenshot.com/MagicScreenshot/oiEtfaWIz0Y.jpg

    why?

     

    private void UserControl_MouseUp(object sender, MouseButtonEventArgs e)

    {

     

    if (UnSelectAll != null)

    UnSelectAll();

     

    Thickness think = new Thickness(2);

    borderMain.BorderThickness = think;

    }

    • 已编辑ORover 2009年6月28日 20:09
    •  

全部回复

  • 2009年7月2日 9:28Hua ChenMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hello ORover,

      this works fine in following areas (green) and does not work in red.

     Could you please tell more about the green and red areas?

     Or could you please clarify what work? 
      

    Thanks
    Please mark the replies as answers if they help and unmark them if they provide no help
  • 2009年7月4日 22:30ORover 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hello ORover,

      this works fine in following areas (green) and does not work in red.

     Could you please tell more about the green and red areas?

     Or could you please clarify what work? 
      

    Thanks
    Please mark the replies as answers if they help and unmark them if they provide no help

    What is more? Do you see link ?
    I show full code of control and link where it is work and where not :)
  • 2009年7月4日 23:08Kenneth Haugland 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hello ORover,

      this works fine in following areas (green) and does not work in red.

     Could you please tell more about the green and red areas?

     Or could you please clarify what work? 
      

    Thanks
    Please mark the replies as answers if they help and unmark them if they provide no help

    What is more? Do you see link ?
    I show full code of control and link where it is work and where not :)
    Hmm... If I would take that literally it would mean that all the properties dont work... And your xaml code that is commented out does.......

    Kenneth