zoukankan      html  css  js  c++  java
  • WPF在XAML的资源中定义空字符串String.Empty

    代码如下:

    <!--1. 首先引用System的命名空间-->

        <Window x:Class="DriverEasyWPF.Views.DialogWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib">
          <Window.Resources>

    <!--2.正常的定义String类型资源-->

               <sys:Stirng x:Key="str1">test1</sys:String>

        <sys:Stirng x:Key="str1">test1</sys:String>
    <!--3.定义空的String类型资源要用x:Static-->
           <x:Static x:Key="empty" Member="sys:String.Empty" />
      </Window.Resources>

      </Windows>

  • 相关阅读:
    添加右键菜单
    闭包和迭代器
    函数的进阶
    函数入门
    文件操作
    深浅拷贝
    小数据池和再谈编码
    字典
    list tuple
    int bool str
  • 原文地址:https://www.cnblogs.com/tommy-huang/p/5416349.html
Copyright © 2011-2022 走看看