silverlight   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了silverlight全屏显示图片大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

前台页面代码:   <UserControl x:Class="SilverlightApplicationDome.fullScreenDome"     xmlns="http://scheR_635_11845@as.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://scheR_635_11845@as.microsoft.com/winfx/2006/xa

前台页面代码

 

<UserControl x:Class="SilverlightApplicationDome.fullScreenDome"
    xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="
http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="
http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
   
    <Grid x:Name="LayoutRoot" BACkground="White">
        <Image Name="full" source="img/3.jpg" Stretch="UniformToFill"></Image>
        <Button Name="btnFull" Width="120" Height="80"  Content="全屏显示" FontSize="24" Click="btnFull_Click"></Button>
    </Grid>
</UserControl>

silverlight全屏显示图片


其实很简单,我们只需要引用命名空间,System.Windows.Interop就可以了。

后台代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Interop;

namespace SilverlightApplicationDome
{
    public partial class fullScreenDome : UserControl
    {
        public fullScreenDome()
        {
            InitializeComponent();
        }

        private void btnFull_Click(object sender,RoutedEventArgs E)         {             Content contentObject = Application.Current.Host.Content;             contentObject.IsFullScreen = !contentObject.IsFullScreen;         }     } }

大佬总结

以上是大佬教程为你收集整理的silverlight全屏显示图片全部内容,希望文章能够帮你解决silverlight全屏显示图片所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。