我在拉伸我的图像以填充按钮时遇到问题,我是UWP的新手,这是我的代码:
<Grid Margin="0,0,0,54" VerticalAlignment="Bottom" Height="39" Style="{Binding HorizontalAlignment, ElementName=grid}" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Height="39" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Image Source="images/icon1.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="True" d:LayoutRounding="Auto" />
</Button>
<Button Grid.Column="1" Height="39" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Image Source="images/icon2.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="True" d:LayoutRounding="Auto" />
</Button>
</Grid>
Run Code Online (Sandbox Code Playgroud) 我正在使用Windows应用商店,我正在尝试发送登录名和密码值,这是我的代码:
try
{
string user = login.Text;
string pass = password.Password;
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "login=" + user + "&mdp=" + pass;
byte[] data = encoding.GetBytes(postData);
WebRequest request = WebRequest.Create("myURL/login.php");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Dispose();
WebResponse response = request.GetResponse();
stream = response.GetResponseStream();
StreamReader sr = new StreamReader(stream);
sr.Dispose();
stream.Dispose();
}
catch (Exception ex)
{
ex.Message.ToString();
}
Run Code Online (Sandbox Code Playgroud)
我有很多这样的错误:
'WebRequest' does not contain a definition for …Run Code Online (Sandbox Code Playgroud) 我试图在通用应用程序中将Text设置为RichTextBlock,这是我在xaml中的代码:
<RichTextBlock x:Name="descr">
<Paragraph>
<Paragraph.Inlines>
<Run Text="{Binding Path=desc}"/>
</Paragraph.Inlines>
</Paragraph>
</RichTextBlock>
Run Code Online (Sandbox Code Playgroud)
但我不知道如何在代码背后的RichTextBlock中设置Text,这是我的尝试:
Paragraph p = new Paragraph();
p.Inlines.Add("test");//error here cannot convert from 'string' to 'Windows.UI.Xaml.Documents.Inline'
descr.Blocks.Add(p);
Run Code Online (Sandbox Code Playgroud)
那么如何在C#后面的代码中将Text设置为RichTextBlock,感谢您的帮助
我创建了一个ContentDialog套用样式(我不能用一个消息对话框,然后弹出的应用),但我有它的问题,它是不可移动的或我不能关闭它像出现的框,当我单击Groove应用程序中的"Connexion"按钮

请你有任何想法,我可以在ContentDialog样式中修改哪一部分,以使这个ContentDialog可以移动并关闭它像顶部的图像
我在一个通用应用程序上工作