小编Joe*_*e B的帖子

Xamarin Forms Span保留空白

我如何在Xamarin Forms的Formatted Text Label中保留空白,我尝试过此操作,但似乎不起作用

            <Label FontSize="Medium">
                <Label.FormattedText>
                    <FormattedString>
                        <Span xml:space="preserve">On PO: </Span>
                        <Span xml:space="preserve"> </Span>
                        <Span FontAttributes="Bold"  FontSize="Large" Text="{Binding Qty}"/>
                    </FormattedString>
                </Label.FormattedText>
            </Label>
Run Code Online (Sandbox Code Playgroud)

我得到这个错误

Error Position 22:35. No property, bindable property, or event found for 'space', or mismatching type between value and property.

c# xaml xamarin.forms

5
推荐指数
1
解决办法
851
查看次数

NET Core:ManagementObjectSearcher 在初始化时抛出异常

ManagementObjectSearcher我正在尝试使用以下代码运行查询:(net core 2.1)

 ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * from Win32_Printer");
    ManagementObjectCollection coll = searcher.Get();
Run Code Online (Sandbox Code Playgroud)

在我的计算机(Windows 10)上它工作正常,但在客户端计算机 Windows Server 2012R2 上我收到以下错误:

`Unhandled Exception: System.TypeInitializationException: The type initializer fo
r 'System.Management.ManagementPath' threw an exception. ---> System.TypeInitial
izationException: The type initializer for 'System.Management.WmiNetUtilsHelper'
 threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: ptr
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPt
r ptr, Type t)
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer[TDele
gate](IntPtr ptr)
   at System.Management.WmiNetUtilsHelper.LoadDelegate[TDelegate](TDelegate& del
egate_f, IntPtr hModule, String procName)
   at System.Management.WmiNetUtilsHelper..cctor()
   --- End of inner exception stack …
Run Code Online (Sandbox Code Playgroud)

c# .net-core

2
推荐指数
1
解决办法
3305
查看次数

标签 统计

c# ×2

.net-core ×1

xamarin.forms ×1

xaml ×1