我需要的设定背景上的StackPanel在资源一定的图像.
我知道我应该设置背景如下:
Stack.Background= image; // don't know of what type the image should be how to set it
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏,
string fileName = "/Background.png";
BitmapImage image = new BitmapImage(new Uri(fileName, UriKind.Relative));
ImageBrush brush = new ImageBrush();
brush.ImageSource = image;
stack.Background = brush;
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4370 次 |
最近记录: |