xamlload先在xaml做出一个grid,命名xgrid
用和前面写
<Button x:Name="button" Content="Button" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Click="button_Click"/>
但是位置不一样的按钮 private void button_Click(object sender , RoutedEventArgs e) { string usingXaml = " xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" "; string contentXaml = ""; Button b = XamlReader.Load(contentXaml+usingXaml + marginXaml) as Button; xgrid.Children.Add(b); }
<script type="text/javascript"> $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').length; var $numbering = $('<ul/>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('<li/>').text(i)); }; $numbering.fadeIn(1700); }); }); </script>
版权声明:本文为博主原创文章,未经博主允许不得转载。