Ask a questionAsk a question
 

Questionis this bug?

  • Sunday, June 28, 2009 8:06 PMORover Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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;

    }

    • Edited byORover Sunday, June 28, 2009 8:09 PM
    •  

All Replies

  • Thursday, July 02, 2009 9:28 AMHua ChenMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Saturday, July 04, 2009 10:30 PMORover Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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 :)
  • Saturday, July 04, 2009 11:08 PMKenneth Haugland Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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