我希望在Powershell ISE内的第二个myScript2.ps1脚本中调用myScript1.ps1脚本.
MyScript2.ps1中的以下代码在Powershell Administration中运行良好,但在PowerShell ISE中不起作用:
#Call myScript1 from myScript2
invoke-expression -Command .\myScript1.ps1
Run Code Online (Sandbox Code Playgroud)
从PowerShell ISE执行MyScript2.ps1时出现以下错误:
术语".\ myScript1.ps1"未被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.
我需要为我的应用程序创建一个图像按钮,如面向Web的样式.我有一个20x20像素的图像,并希望图像按钮具有相同的图像尺寸.
我试图在我的xaml中设置它但它不起作用:
<Button Grid.Row="0" Margin="0" Padding="0" Click="AddtoFavorite_Click" Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right">
<Button.Content>
<Image Source="/MyNamespace;component/images/star_yellow.png" Margin="0" Width="20" Height="20" />
</Button.Content>
</Button>
Run Code Online (Sandbox Code Playgroud)
怎么了?
我发现最好的解决方案是:
<Image Source="/MyNamespace;component/images/star_yellow.png" ManipulationStarted="Image_ManipulationStarted" Width="20" Height="20"></Image>
Run Code Online (Sandbox Code Playgroud)
谢谢大家!
我正在开发我的第一个Windows Phone 7应用程序,我必须添加带有图标的应用程序栏.
I referred to this "How To" : http://msdn.microsoft.com/en-us/library/ff431786(VS.92).aspx ("Creating an Application Bar in XAML" paragraph)
But when I run Emulator I cannot see incons: I see the black circle with X in the center and event ApplicationBarIconButton_Click correctly raised.
I'm using icon from WP7AppBarIcons.zip samples and my code is posted below:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/images/appbar.transport.play.rest.png" Text="Home" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBarIconButton IconUri="/images/appbar.favs.rest.png" Text="Preferiti" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBarIconButton IconUri="/images/appbar.questionmark.rest.png" Text="About" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar> …Run Code Online (Sandbox Code Playgroud)