질문하기질문하기
 

질문is this bug?

  • 2009년 6월 28일 일요일 오후 8: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일 일요일 오후 8: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일 토요일 오후 10: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일 토요일 오후 11: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