小编Jua*_*llo的帖子

从Windows 10 UWP中的路径启动文件

我试图以多种方式从计算机启动文件,假设是d:\ a.pdf

1.-尝试使用Launcher.LaunchFileAsync,但需要应该是GetFileFromPathAsync的StorageFile,但是每个人都知道W10应用程序未经授权打开这样的路径.

2.-尝试使用file:/// like file:/// d:/a.pdf,但它只返回false

var success = await Launcher.LaunchUriAsync(new Uri("file:///d:/a.pdf", UriKind.Absolute), options); 
Run Code Online (Sandbox Code Playgroud)

3.- Launcher.FindFileHandlersAsync()都不返回空.

那么有没有办法启动文件?

c# io windows-10 uwp

7
推荐指数
1
解决办法
3190
查看次数

如何在Windows Apps中更改RelativePanel附加属性?

我试图在可视状态的VisualState.Setters中通过XAML更改控件的RelativePanel附加属性,但属性不会更改,因此我创建了一个依赖项属性,以便通过代码进行测试,两者都没有.

有没有办法刷新到一组新的值,如:

 <VisualState.Setters>
      <Setter Target="TimestablesControl.RelativePanel.RightOf" Value=""/>
      <Setter Target="TimestablesControl.RelativePanel.AlignRightWithPanel" Value="false"/>
      <Setter Target="TimestablesControl.RelativePanel.AlignLeftWithPanel" Value="true"/> 
 </VisualState.Setters>
Run Code Online (Sandbox Code Playgroud)

并使视图更"响应"?

xaml attached-properties win-universal-app windows-10 uwp-xaml

6
推荐指数
1
解决办法
1063
查看次数

在Windows 10 UWP中具有自定义附加属性的自适应触发器

我试图在视觉状态中设置一个自定义附加属性我已经尝试了几种方式与完整的命名空间,没有,别名,等没有成功任何想法?

xmlns:p="using:Controls.Views.Properties"
<RelativePanel x:Name="RootPanel" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="VisualStateGroup">
            <VisualState x:Name="NarrowView">
                <VisualState.StateTriggers>
                    <AdaptiveTrigger MinWindowWidth="0" />
                </VisualState.StateTriggers>
                <VisualState.Setters>
     //This is where the value is not achieved
     <Setter Target="Text.(p:RelativeSize.Width)" Value="0.5"/>
Run Code Online (Sandbox Code Playgroud)

它不只是触发任何错误,我可以用j代替p:并且它不会崩溃,我不知道如何解决这个问题.

这个问题是在这里完成解决方案: 使用UWP应用程序在XAML中使用RelativePanel的UI元素的相对宽度

xaml windows-10 uwp

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

WPF - 网络浏览器 - getElementById

在 WPF 应用程序中,我有一个名为 WebBrowser1 的网络浏览器。这是指包含用户可以输入文本的 TextArea 的 HTML 页面。

<html>
<body>
<textarea class="myStudentInput" id="myStudentInput1">
Text to be copied
</textarea>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

我希望获得此文本并可能还设置此文本。

我尝试了类似于 javascript 编写方式的方法:

document.getElementById("myStudentOutput1").innerHTML;
Run Code Online (Sandbox Code Playgroud)

HtmlElement textArea = webBrowser1.Document.All["myStudentInput1"];

dynamic textArea = WebBrowser1.Document.GetElementsByID("myStudentInput1").InnerText;
Run Code Online (Sandbox Code Playgroud)

但它不起作用。

c# webbrowser-control getelementbyid

3
推荐指数
1
解决办法
7920
查看次数