parent
b735667ee8
commit
80d7bdcfb7
@ -0,0 +1,14 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||||
|
<Shell |
||||||
|
x:Class="MyFirstMAUI.AppShell" |
||||||
|
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
||||||
|
xmlns:local="clr-namespace:MyFirstMAUI" |
||||||
|
Shell.FlyoutBehavior="Disabled"> |
||||||
|
|
||||||
|
<ShellContent |
||||||
|
Title="Lotto Picker" |
||||||
|
ContentTemplate="{DataTemplate local:MainPage}" |
||||||
|
Route="MainPage" /> |
||||||
|
|
||||||
|
</Shell> |
@ -0,0 +1,44 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||||
|
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
||||||
|
x:Class="MyFirstMAUI.CustomControl.BallView"> |
||||||
|
|
||||||
|
<Grid> |
||||||
|
<Grid.RowDefinitions> |
||||||
|
<RowDefinition Height="60"/> |
||||||
|
<RowDefinition Height="*"/> |
||||||
|
</Grid.RowDefinitions> |
||||||
|
|
||||||
|
<Picker |
||||||
|
x:Name="picker" |
||||||
|
Grid.Row="0" |
||||||
|
HorizontalOptions="Center" |
||||||
|
HorizontalTextAlignment="Center" |
||||||
|
SelectedIndex="0" |
||||||
|
SelectedIndexChanged="picker_SelectedIndexChanged"> |
||||||
|
<Picker.ItemsSource> |
||||||
|
<x:Array Type="{x:Type x:String}"> |
||||||
|
<x:String>노랑</x:String> |
||||||
|
<x:String>파랑</x:String> |
||||||
|
<x:String>빨강</x:String> |
||||||
|
<x:String>회색</x:String> |
||||||
|
<x:String>초록</x:String> |
||||||
|
</x:Array> |
||||||
|
</Picker.ItemsSource> |
||||||
|
</Picker> |
||||||
|
<Ellipse |
||||||
|
x:Name="ellipse" |
||||||
|
Grid.Row="1" |
||||||
|
WidthRequest="100" |
||||||
|
HeightRequest="100" |
||||||
|
Stroke="LightGray" |
||||||
|
StrokeThickness="20"/> |
||||||
|
<Label |
||||||
|
x:Name="number" |
||||||
|
Grid.Row="1" |
||||||
|
HorizontalTextAlignment="Center" |
||||||
|
VerticalTextAlignment="Center" |
||||||
|
FontSize="35" |
||||||
|
FontAttributes="Bold"/> |
||||||
|
</Grid> |
||||||
|
</ContentView> |
@ -0,0 +1,48 @@ |
|||||||
|
using MyFirstMAUI.Utility; |
||||||
|
|
||||||
|
namespace MyFirstMAUI.CustomControl; |
||||||
|
|
||||||
|
public partial class BallView : ContentView |
||||||
|
{ |
||||||
|
public BallView() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
picker.SelectedIndex = 0; |
||||||
|
} |
||||||
|
|
||||||
|
public void Pick() |
||||||
|
{ |
||||||
|
int index = picker.SelectedIndex; |
||||||
|
ellipse.Stroke = Utils.Palettes[index]; |
||||||
|
|
||||||
|
int num = Utils.GetNumber(index); |
||||||
|
number.Text = num.ToString(); |
||||||
|
} |
||||||
|
|
||||||
|
public int Pick(List<int> alreadySelected) |
||||||
|
{ |
||||||
|
int index = picker.SelectedIndex; |
||||||
|
ellipse.Stroke = Utils.Palettes[index]; |
||||||
|
|
||||||
|
int num = Utils.GetNumber(index); |
||||||
|
while (alreadySelected.Contains(num)) |
||||||
|
{ |
||||||
|
num = Utils.GetNumber(index); |
||||||
|
} |
||||||
|
|
||||||
|
number.Text = num.ToString(); |
||||||
|
|
||||||
|
return num; |
||||||
|
} |
||||||
|
|
||||||
|
private void picker_SelectedIndexChanged(object sender, EventArgs e) |
||||||
|
{ |
||||||
|
number.Text = ""; |
||||||
|
|
||||||
|
int index = picker.SelectedIndex; |
||||||
|
if (index < 0) |
||||||
|
return; |
||||||
|
|
||||||
|
ellipse.Stroke = Utils.Palettes[index]; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,6 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<resources> |
||||||
|
<color name="colorPrimary">#512BD4</color> |
||||||
|
<color name="colorPrimaryDark">#2B0B98</color> |
||||||
|
<color name="colorAccent">#2B0B98</color> |
||||||
|
</resources> |
@ -0,0 +1,30 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||||
|
<plist version="1.0"> |
||||||
|
<dict> |
||||||
|
<key>UIDeviceFamily</key> |
||||||
|
<array> |
||||||
|
<integer>1</integer> |
||||||
|
<integer>2</integer> |
||||||
|
</array> |
||||||
|
<key>UIRequiredDeviceCapabilities</key> |
||||||
|
<array> |
||||||
|
<string>arm64</string> |
||||||
|
</array> |
||||||
|
<key>UISupportedInterfaceOrientations</key> |
||||||
|
<array> |
||||||
|
<string>UIInterfaceOrientationPortrait</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string> |
||||||
|
</array> |
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key> |
||||||
|
<array> |
||||||
|
<string>UIInterfaceOrientationPortrait</string> |
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string> |
||||||
|
</array> |
||||||
|
<key>XSAppIconAssets</key> |
||||||
|
<string>Assets.xcassets/appicon.appiconset</string> |
||||||
|
</dict> |
||||||
|
</plist> |
@ -0,0 +1,16 @@ |
|||||||
|
using System; |
||||||
|
using Microsoft.Maui; |
||||||
|
using Microsoft.Maui.Hosting; |
||||||
|
|
||||||
|
namespace MyFirstMAUI; |
||||||
|
|
||||||
|
class Program : MauiApplication |
||||||
|
{ |
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); |
||||||
|
|
||||||
|
static void Main(string[] args) |
||||||
|
{ |
||||||
|
var app = new Program(); |
||||||
|
app.Run(args); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyFirstMAUI.WinUI.app"/> |
||||||
|
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3"> |
||||||
|
<windowsSettings> |
||||||
|
<!-- The combination of below two tags have the following effect: |
||||||
|
1) Per-Monitor for >= Windows 10 Anniversary Update |
||||||
|
2) System < Windows 10 Anniversary Update |
||||||
|
--> |
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware> |
||||||
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness> |
||||||
|
</windowsSettings> |
||||||
|
</application> |
||||||
|
</assembly> |
@ -0,0 +1,32 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||||
|
<plist version="1.0"> |
||||||
|
<dict> |
||||||
|
<key>LSRequiresIPhoneOS</key> |
||||||
|
<true/> |
||||||
|
<key>UIDeviceFamily</key> |
||||||
|
<array> |
||||||
|
<integer>1</integer> |
||||||
|
<integer>2</integer> |
||||||
|
</array> |
||||||
|
<key>UIRequiredDeviceCapabilities</key> |
||||||
|
<array> |
||||||
|
<string>arm64</string> |
||||||
|
</array> |
||||||
|
<key>UISupportedInterfaceOrientations</key> |
||||||
|
<array> |
||||||
|
<string>UIInterfaceOrientationPortrait</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string> |
||||||
|
</array> |
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key> |
||||||
|
<array> |
||||||
|
<string>UIInterfaceOrientationPortrait</string> |
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string> |
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string> |
||||||
|
</array> |
||||||
|
<key>XSAppIconAssets</key> |
||||||
|
<string>Assets.xcassets/appicon.appiconset</string> |
||||||
|
</dict> |
||||||
|
</plist> |
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
"profiles": { |
||||||
|
"Windows Machine": { |
||||||
|
"commandName": "MsixPackage", |
||||||
|
"nativeDebugging": false |
||||||
|
} |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.8 KiB |
Loading…
Reference in new issue