WPF中常用控件的属性

时间:2022-01-31 21:34:09
Source = new BitmapImage( new Uri( WangCaiConfig.GetCurrentDirectory() + imgStr, UriKind.RelativeOrAbsolute))
  this.PictureImage.Source = new BitmapImage( new Uri(img, UriKind.RelativeOrAbsolute));

Canvas.Right="10": Canvas.SetRight(stateImage, 0);
  Canvas.Bottom="0" : Canvas.SetBottom(stateImage, 0);

:  Margin = new Thickness(20, 0, 0, 0),
    Padding="5,0,0,0":   Padding = new Thickness(5, 0, 0, 0),

Foreground ="#333":  Foreground = new SolidColorBrush((Color )ColorConverter .ConvertFromString("#333"))

 
  Style = (System.Windows.Style)FindResource( "FriendPhoneStyle"),
 canvas.Background = Brushes.White;
      Background = new SolidColorBrush((Color )ColorConverter .ConvertFromString("#fff")),

//获取文件夹的路径,放进数组中
                    path = WangCaiConfig.GetCurrentDirectory() + "RecommendPictures" ;
                    dirs = Directory.GetFiles(path);

 
 
IsNullOrWhiteSpace(不为空)
 
 
HorizontalAlignment = HorizontalAlignment.Stretch,
 
 
  this.RegisterName( "LXR_List" + user.Id, canVasRoot_button);注册事件 
 
设置位置
 Canvas.SetRight(canVasRoot_button_canvas_image_2, 0);
  Canvas.SetBottom(canVasRoot_button_canvas_image_2, 0);
 
取下一级控件
      var button = canva.Children[1] as Button;