Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] WPF DynamicGrid python and XAML layout files#280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vmuriart merged 2 commits intopythonnet:masterfromden-run-ai:wpf
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
WPF DynamicGrid python and XAML layout files
  • Loading branch information
@den-run-ai
denfromufa authored andden-run-ai committedMar 23, 2016
commitef51247412dcd37f223bcb66d7d505fad12f9c5d
23 changes: 23 additions & 0 deletionsdemo/DynamicGrid.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
import clr
import sys
if sys.platform.lower() not in ['cli','win32']:
print("only windows is supported for wpf")
clr.AddReference(r"wpf\PresentationFramework")
from System.IO import StreamReader
from System.Windows.Markup import XamlReader
from System.Threading import Thread, ThreadStart, ApartmentState
from System.Windows import Application, Window


class MyWindow(Window):
def __init__(self):
stream = StreamReader("DynamicGrid.xaml")
window = XamlReader.Load(stream.BaseStream)
Application().Run(window)


if __name__ == '__main__':
thread = Thread(ThreadStart(MyWindow))
thread.SetApartmentState(ApartmentState.STA)
thread.Start()
thread.Join()
34 changes: 34 additions & 0 deletionsdemo/DynamicGrid.xaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WpfApplication1" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Content="Left" Grid.Column="0" Background="LightBlue" />
<GridSplitter
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Grid.Column="1"
Width="5"
Grid.RowSpan="3"/>
<Label Content="Right" Grid.Column="2" Grid.Row="2" Background="LightBlue" />
<Label Content="Top" Grid.Column="2" Background="LightGreen"/>
<GridSplitter
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Grid.Row="1"
Width="Auto"
Height="5"
Grid.ColumnSpan="3"/>
<Label Content="Bottom" Grid.Column="0" Grid.Row="2" Background="LightGreen" />
</Grid>
</Window>

[8]ページ先頭

©2009-2025 Movatter.jp