Browse Source
# Conflicts: # src/Avalonia.Controls/ApiCompatBaseline.txt # src/Avalonia.Controls/Screens.cspull/7165/head
850 changed files with 31918 additions and 18208 deletions
@ -0,0 +1,5 @@ |
|||||
|
<ProjectConfiguration> |
||||
|
<Settings> |
||||
|
<IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> |
||||
|
</Settings> |
||||
|
</ProjectConfiguration> |
||||
@ -0,0 +1,5 @@ |
|||||
|
<ProjectConfiguration> |
||||
|
<Settings> |
||||
|
<IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> |
||||
|
</Settings> |
||||
|
</ProjectConfiguration> |
||||
@ -0,0 +1,5 @@ |
|||||
|
<ProjectConfiguration> |
||||
|
<Settings> |
||||
|
<IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> |
||||
|
</Settings> |
||||
|
</ProjectConfiguration> |
||||
@ -1,16 +0,0 @@ |
|||||
<Project> |
|
||||
<ItemGroup Condition="'$(AndroidApplication)' == 'true'"> |
|
||||
<!-- WORKAROUND: The packages below are transitively referenced by System.Memory, |
|
||||
but Xamarin.Android applications need the newest versions directly referenced for the linker. --> |
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.6.0" /> |
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" /> |
|
||||
</ItemGroup> |
|
||||
<Target Name="_RemoveNonExistingResgenFile" BeforeTargets="CoreCompile" Condition="'$(_SdkSetAndroidResgenFile)' == 'true' And '$(AndroidResgenFile)' != '' And !Exists('$(AndroidResgenFile)')"> |
|
||||
<ItemGroup> |
|
||||
<Compile Remove="$(AndroidResgenFile)"/> |
|
||||
</ItemGroup> |
|
||||
</Target> |
|
||||
<PropertyGroup> |
|
||||
<DesignTimeBuild>false</DesignTimeBuild> |
|
||||
</PropertyGroup> |
|
||||
</Project> |
|
||||
@ -1,7 +1,7 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="HarfBuzzSharp" Version="2.8.2-preview.178" /> |
<PackageReference Include="HarfBuzzSharp" Version="2.8.2-preview.209" /> |
||||
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2-preview.178" /> |
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2-preview.209" /> |
||||
<PackageReference Condition="'$(IncludeWasmSkia)' == 'true'" Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="2.8.2-preview.178"/> |
<PackageReference Condition="'$(IncludeWasmSkia)' == 'true'" Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="2.8.2-preview.209"/> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,7 +1,7 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="SkiaSharp" Version="2.88.0-preview.178" /> |
<PackageReference Include="SkiaSharp" Version="2.88.0-preview.209" /> |
||||
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.178" /> |
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.209" /> |
||||
<PackageReference Condition="'$(IncludeWasmSkia)' == 'true'" Include="SkiaSharp.NativeAssets.WebAssembly" Version="2.88.0-preview.178"/> |
<PackageReference Condition="'$(IncludeWasmSkia)' == 'true'" Include="SkiaSharp.NativeAssets.WebAssembly" Version="2.88.0-preview.209"/> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,5 +1,6 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="System.Drawing.Common" Version="4.5.0" /> |
<PackageReference Condition="'$(TargetFramework)'!='netstandard2.0'" Include="System.Drawing.Common" Version="6.0.0" /> |
||||
|
<PackageReference Condition="'$(TargetFramework)'=='netstandard2.0'" Include="System.Drawing.Common" Version="4.5.0" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -0,0 +1,12 @@ |
|||||
|
#import <Cocoa/Cocoa.h> |
||||
|
#include "window.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
class IAvnAutomationPeer; |
||||
|
|
||||
|
@interface AvnAccessibilityElement : NSAccessibilityElement |
||||
|
+ (AvnAccessibilityElement *) acquire:(IAvnAutomationPeer *) peer; |
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,496 @@ |
|||||
|
#include "common.h" |
||||
|
#include "automation.h" |
||||
|
#include "AvnString.h" |
||||
|
#include "window.h" |
||||
|
|
||||
|
@interface AvnAccessibilityElement (Events) |
||||
|
- (void) raiseChildrenChanged; |
||||
|
@end |
||||
|
|
||||
|
@interface AvnRootAccessibilityElement : AvnAccessibilityElement |
||||
|
- (AvnView *) ownerView; |
||||
|
- (AvnRootAccessibilityElement *) initWithPeer:(IAvnAutomationPeer *) peer owner:(AvnView*) owner; |
||||
|
- (void) raiseFocusChanged; |
||||
|
@end |
||||
|
|
||||
|
class AutomationNode : public ComSingleObject<IAvnAutomationNode, &IID_IAvnAutomationNode> |
||||
|
{ |
||||
|
public: |
||||
|
FORWARD_IUNKNOWN() |
||||
|
|
||||
|
AutomationNode(AvnAccessibilityElement* owner) |
||||
|
{ |
||||
|
_owner = owner; |
||||
|
} |
||||
|
|
||||
|
AvnAccessibilityElement* GetOwner() |
||||
|
{ |
||||
|
return _owner; |
||||
|
} |
||||
|
|
||||
|
virtual void Dispose() override |
||||
|
{ |
||||
|
_owner = nil; |
||||
|
} |
||||
|
|
||||
|
virtual void ChildrenChanged () override |
||||
|
{ |
||||
|
[_owner raiseChildrenChanged]; |
||||
|
} |
||||
|
|
||||
|
virtual void PropertyChanged (AvnAutomationProperty property) override |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
virtual void FocusChanged () override |
||||
|
{ |
||||
|
[(AvnRootAccessibilityElement*)_owner raiseFocusChanged]; |
||||
|
} |
||||
|
|
||||
|
private: |
||||
|
__strong AvnAccessibilityElement* _owner; |
||||
|
}; |
||||
|
|
||||
|
@implementation AvnAccessibilityElement |
||||
|
{ |
||||
|
IAvnAutomationPeer* _peer; |
||||
|
AutomationNode* _node; |
||||
|
NSMutableArray* _children; |
||||
|
} |
||||
|
|
||||
|
+ (AvnAccessibilityElement *)acquire:(IAvnAutomationPeer *)peer |
||||
|
{ |
||||
|
if (peer == nullptr) |
||||
|
return nil; |
||||
|
|
||||
|
auto instance = peer->GetNode(); |
||||
|
|
||||
|
if (instance != nullptr) |
||||
|
return dynamic_cast<AutomationNode*>(instance)->GetOwner(); |
||||
|
|
||||
|
if (peer->IsRootProvider()) |
||||
|
{ |
||||
|
auto window = peer->RootProvider_GetWindow(); |
||||
|
auto holder = dynamic_cast<INSWindowHolder*>(window); |
||||
|
auto view = holder->GetNSView(); |
||||
|
return [[AvnRootAccessibilityElement alloc] initWithPeer:peer owner:view]; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return [[AvnAccessibilityElement alloc] initWithPeer:peer]; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
- (AvnAccessibilityElement *)initWithPeer:(IAvnAutomationPeer *)peer |
||||
|
{ |
||||
|
self = [super init]; |
||||
|
_peer = peer; |
||||
|
_node = new AutomationNode(self); |
||||
|
_peer->SetNode(_node); |
||||
|
return self; |
||||
|
} |
||||
|
|
||||
|
- (void)dealloc |
||||
|
{ |
||||
|
if (_node) |
||||
|
delete _node; |
||||
|
_node = nullptr; |
||||
|
} |
||||
|
|
||||
|
- (NSString *)description |
||||
|
{ |
||||
|
return [NSString stringWithFormat:@"%@ '%@' (%p)", |
||||
|
GetNSStringAndRelease(_peer->GetClassName()), |
||||
|
GetNSStringAndRelease(_peer->GetName()), |
||||
|
_peer]; |
||||
|
} |
||||
|
|
||||
|
- (IAvnAutomationPeer *)peer |
||||
|
{ |
||||
|
return _peer; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)isAccessibilityElement |
||||
|
{ |
||||
|
return _peer->IsControlElement(); |
||||
|
} |
||||
|
|
||||
|
- (NSAccessibilityRole)accessibilityRole |
||||
|
{ |
||||
|
auto controlType = _peer->GetAutomationControlType(); |
||||
|
|
||||
|
switch (controlType) { |
||||
|
case AutomationButton: return NSAccessibilityButtonRole; |
||||
|
case AutomationCalendar: return NSAccessibilityGridRole; |
||||
|
case AutomationCheckBox: return NSAccessibilityCheckBoxRole; |
||||
|
case AutomationComboBox: return NSAccessibilityPopUpButtonRole; |
||||
|
case AutomationComboBoxItem: return NSAccessibilityMenuItemRole; |
||||
|
case AutomationEdit: return NSAccessibilityTextFieldRole; |
||||
|
case AutomationHyperlink: return NSAccessibilityLinkRole; |
||||
|
case AutomationImage: return NSAccessibilityImageRole; |
||||
|
case AutomationListItem: return NSAccessibilityRowRole; |
||||
|
case AutomationList: return NSAccessibilityTableRole; |
||||
|
case AutomationMenu: return NSAccessibilityMenuBarRole; |
||||
|
case AutomationMenuBar: return NSAccessibilityMenuBarRole; |
||||
|
case AutomationMenuItem: return NSAccessibilityMenuItemRole; |
||||
|
case AutomationProgressBar: return NSAccessibilityProgressIndicatorRole; |
||||
|
case AutomationRadioButton: return NSAccessibilityRadioButtonRole; |
||||
|
case AutomationScrollBar: return NSAccessibilityScrollBarRole; |
||||
|
case AutomationSlider: return NSAccessibilitySliderRole; |
||||
|
case AutomationSpinner: return NSAccessibilityIncrementorRole; |
||||
|
case AutomationStatusBar: return NSAccessibilityTableRole; |
||||
|
case AutomationTab: return NSAccessibilityTabGroupRole; |
||||
|
case AutomationTabItem: return NSAccessibilityRadioButtonRole; |
||||
|
case AutomationText: return NSAccessibilityStaticTextRole; |
||||
|
case AutomationToolBar: return NSAccessibilityToolbarRole; |
||||
|
case AutomationToolTip: return NSAccessibilityPopoverRole; |
||||
|
case AutomationTree: return NSAccessibilityOutlineRole; |
||||
|
case AutomationTreeItem: return NSAccessibilityCellRole; |
||||
|
case AutomationCustom: return NSAccessibilityUnknownRole; |
||||
|
case AutomationGroup: return NSAccessibilityGroupRole; |
||||
|
case AutomationThumb: return NSAccessibilityHandleRole; |
||||
|
case AutomationDataGrid: return NSAccessibilityGridRole; |
||||
|
case AutomationDataItem: return NSAccessibilityCellRole; |
||||
|
case AutomationDocument: return NSAccessibilityStaticTextRole; |
||||
|
case AutomationSplitButton: return NSAccessibilityPopUpButtonRole; |
||||
|
case AutomationWindow: return NSAccessibilityWindowRole; |
||||
|
case AutomationPane: return NSAccessibilityGroupRole; |
||||
|
case AutomationHeader: return NSAccessibilityGroupRole; |
||||
|
case AutomationHeaderItem: return NSAccessibilityButtonRole; |
||||
|
case AutomationTable: return NSAccessibilityTableRole; |
||||
|
case AutomationTitleBar: return NSAccessibilityGroupRole; |
||||
|
// Treat unknown roles as generic group container items. Returning |
||||
|
// NSAccessibilityUnknownRole is also possible but makes the screen |
||||
|
// reader focus on the item instead of passing focus to child items. |
||||
|
default: return NSAccessibilityGroupRole; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
- (NSString *)accessibilityIdentifier |
||||
|
{ |
||||
|
return GetNSStringAndRelease(_peer->GetAutomationId()); |
||||
|
} |
||||
|
|
||||
|
- (NSString *)accessibilityTitle |
||||
|
{ |
||||
|
// StaticText exposes its text via the value property. |
||||
|
if (_peer->GetAutomationControlType() != AutomationText) |
||||
|
{ |
||||
|
return GetNSStringAndRelease(_peer->GetName()); |
||||
|
} |
||||
|
|
||||
|
return [super accessibilityTitle]; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityValue |
||||
|
{ |
||||
|
if (_peer->IsRangeValueProvider()) |
||||
|
{ |
||||
|
return [NSNumber numberWithDouble:_peer->RangeValueProvider_GetValue()]; |
||||
|
} |
||||
|
else if (_peer->IsToggleProvider()) |
||||
|
{ |
||||
|
switch (_peer->ToggleProvider_GetToggleState()) { |
||||
|
case 0: return [NSNumber numberWithBool:NO]; |
||||
|
case 1: return [NSNumber numberWithBool:YES]; |
||||
|
default: return [NSNumber numberWithInt:2]; |
||||
|
} |
||||
|
} |
||||
|
else if (_peer->IsValueProvider()) |
||||
|
{ |
||||
|
return GetNSStringAndRelease(_peer->ValueProvider_GetValue()); |
||||
|
} |
||||
|
else if (_peer->GetAutomationControlType() == AutomationText) |
||||
|
{ |
||||
|
return GetNSStringAndRelease(_peer->GetName()); |
||||
|
} |
||||
|
|
||||
|
return [super accessibilityValue]; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityMinValue |
||||
|
{ |
||||
|
if (_peer->IsRangeValueProvider()) |
||||
|
{ |
||||
|
return [NSNumber numberWithDouble:_peer->RangeValueProvider_GetMinimum()]; |
||||
|
} |
||||
|
|
||||
|
return [super accessibilityMinValue]; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityMaxValue |
||||
|
{ |
||||
|
if (_peer->IsRangeValueProvider()) |
||||
|
{ |
||||
|
return [NSNumber numberWithDouble:_peer->RangeValueProvider_GetMaximum()]; |
||||
|
} |
||||
|
|
||||
|
return [super accessibilityMaxValue]; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)isAccessibilityEnabled |
||||
|
{ |
||||
|
return _peer->IsEnabled(); |
||||
|
} |
||||
|
|
||||
|
- (BOOL)isAccessibilityFocused |
||||
|
{ |
||||
|
return _peer->HasKeyboardFocus(); |
||||
|
} |
||||
|
|
||||
|
- (NSArray *)accessibilityChildren |
||||
|
{ |
||||
|
if (_children == nullptr && _peer != nullptr) |
||||
|
[self recalculateChildren]; |
||||
|
return _children; |
||||
|
} |
||||
|
|
||||
|
- (NSRect)accessibilityFrame |
||||
|
{ |
||||
|
id topLevel = [self accessibilityTopLevelUIElement]; |
||||
|
auto result = NSZeroRect; |
||||
|
|
||||
|
if ([topLevel isKindOfClass:[AvnRootAccessibilityElement class]]) |
||||
|
{ |
||||
|
auto root = (AvnRootAccessibilityElement*)topLevel; |
||||
|
auto view = [root ownerView]; |
||||
|
|
||||
|
if (view) |
||||
|
{ |
||||
|
auto window = [view window]; |
||||
|
auto bounds = ToNSRect(_peer->GetBoundingRectangle()); |
||||
|
auto windowBounds = [view convertRect:bounds toView:nil]; |
||||
|
auto screenBounds = [window convertRectToScreen:windowBounds]; |
||||
|
result = screenBounds; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityParent |
||||
|
{ |
||||
|
auto parentPeer = _peer->GetParent(); |
||||
|
return parentPeer ? [AvnAccessibilityElement acquire:parentPeer] : [NSApplication sharedApplication]; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityTopLevelUIElement |
||||
|
{ |
||||
|
auto rootPeer = _peer->GetRootPeer(); |
||||
|
return [AvnAccessibilityElement acquire:rootPeer]; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityWindow |
||||
|
{ |
||||
|
id topLevel = [self accessibilityTopLevelUIElement]; |
||||
|
return [topLevel isKindOfClass:[NSWindow class]] ? topLevel : nil; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)isAccessibilityExpanded |
||||
|
{ |
||||
|
if (!_peer->IsExpandCollapseProvider()) |
||||
|
return NO; |
||||
|
return _peer->ExpandCollapseProvider_GetIsExpanded(); |
||||
|
} |
||||
|
|
||||
|
- (void)setAccessibilityExpanded:(BOOL)accessibilityExpanded |
||||
|
{ |
||||
|
if (!_peer->IsExpandCollapseProvider()) |
||||
|
return; |
||||
|
if (accessibilityExpanded) |
||||
|
_peer->ExpandCollapseProvider_Expand(); |
||||
|
else |
||||
|
_peer->ExpandCollapseProvider_Collapse(); |
||||
|
} |
||||
|
|
||||
|
- (BOOL)accessibilityPerformPress |
||||
|
{ |
||||
|
if (_peer->IsInvokeProvider()) |
||||
|
{ |
||||
|
_peer->InvokeProvider_Invoke(); |
||||
|
} |
||||
|
else if (_peer->IsExpandCollapseProvider()) |
||||
|
{ |
||||
|
_peer->ExpandCollapseProvider_Expand(); |
||||
|
} |
||||
|
else if (_peer->IsToggleProvider()) |
||||
|
{ |
||||
|
_peer->ToggleProvider_Toggle(); |
||||
|
} |
||||
|
return YES; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)accessibilityPerformIncrement |
||||
|
{ |
||||
|
if (!_peer->IsRangeValueProvider()) |
||||
|
return NO; |
||||
|
auto value = _peer->RangeValueProvider_GetValue(); |
||||
|
value += _peer->RangeValueProvider_GetSmallChange(); |
||||
|
_peer->RangeValueProvider_SetValue(value); |
||||
|
return YES; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)accessibilityPerformDecrement |
||||
|
{ |
||||
|
if (!_peer->IsRangeValueProvider()) |
||||
|
return NO; |
||||
|
auto value = _peer->RangeValueProvider_GetValue(); |
||||
|
value -= _peer->RangeValueProvider_GetSmallChange(); |
||||
|
_peer->RangeValueProvider_SetValue(value); |
||||
|
return YES; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)accessibilityPerformShowMenu |
||||
|
{ |
||||
|
if (!_peer->IsExpandCollapseProvider()) |
||||
|
return NO; |
||||
|
_peer->ExpandCollapseProvider_Expand(); |
||||
|
return YES; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)isAccessibilitySelected |
||||
|
{ |
||||
|
if (_peer->IsSelectionItemProvider()) |
||||
|
return _peer->SelectionItemProvider_IsSelected(); |
||||
|
return NO; |
||||
|
} |
||||
|
|
||||
|
- (BOOL)isAccessibilitySelectorAllowed:(SEL)selector |
||||
|
{ |
||||
|
if (selector == @selector(accessibilityPerformShowMenu)) |
||||
|
{ |
||||
|
return _peer->IsExpandCollapseProvider() && _peer->ExpandCollapseProvider_GetShowsMenu(); |
||||
|
} |
||||
|
else if (selector == @selector(isAccessibilityExpanded)) |
||||
|
{ |
||||
|
return _peer->IsExpandCollapseProvider(); |
||||
|
} |
||||
|
else if (selector == @selector(accessibilityPerformPress)) |
||||
|
{ |
||||
|
return _peer->IsInvokeProvider() || _peer->IsExpandCollapseProvider() || _peer->IsToggleProvider(); |
||||
|
} |
||||
|
else if (selector == @selector(accessibilityPerformIncrement) || |
||||
|
selector == @selector(accessibilityPerformDecrement) || |
||||
|
selector == @selector(accessibilityMinValue) || |
||||
|
selector == @selector(accessibilityMaxValue)) |
||||
|
{ |
||||
|
return _peer->IsRangeValueProvider(); |
||||
|
} |
||||
|
|
||||
|
return [super isAccessibilitySelectorAllowed:selector]; |
||||
|
} |
||||
|
|
||||
|
- (void)raiseChildrenChanged |
||||
|
{ |
||||
|
auto changed = _children ? [NSMutableSet setWithArray:_children] : [NSMutableSet set]; |
||||
|
|
||||
|
[self recalculateChildren]; |
||||
|
|
||||
|
if (_children) |
||||
|
[changed addObjectsFromArray:_children]; |
||||
|
|
||||
|
NSAccessibilityPostNotificationWithUserInfo( |
||||
|
self, |
||||
|
NSAccessibilityLayoutChangedNotification, |
||||
|
@{ NSAccessibilityUIElementsKey: [changed allObjects]}); |
||||
|
} |
||||
|
|
||||
|
- (void)raisePropertyChanged |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
- (void)setAccessibilityFocused:(BOOL)accessibilityFocused |
||||
|
{ |
||||
|
if (accessibilityFocused) |
||||
|
_peer->SetFocus(); |
||||
|
} |
||||
|
|
||||
|
- (void)recalculateChildren |
||||
|
{ |
||||
|
auto childPeers = _peer->GetChildren(); |
||||
|
auto childCount = childPeers != nullptr ? childPeers->GetCount() : 0; |
||||
|
|
||||
|
if (childCount > 0) |
||||
|
{ |
||||
|
_children = [[NSMutableArray alloc] initWithCapacity:childCount]; |
||||
|
|
||||
|
for (int i = 0; i < childCount; ++i) |
||||
|
{ |
||||
|
IAvnAutomationPeer* child; |
||||
|
|
||||
|
if (childPeers->Get(i, &child) == S_OK) |
||||
|
{ |
||||
|
auto element = [AvnAccessibilityElement acquire:child]; |
||||
|
[_children addObject:element]; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_children = nil; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
@implementation AvnRootAccessibilityElement |
||||
|
{ |
||||
|
AvnView* _owner; |
||||
|
} |
||||
|
|
||||
|
- (AvnRootAccessibilityElement *)initWithPeer:(IAvnAutomationPeer *)peer owner:(AvnView *)owner |
||||
|
{ |
||||
|
self = [super initWithPeer:peer]; |
||||
|
_owner = owner; |
||||
|
|
||||
|
// Seems we need to raise a focus changed notification here if we have focus |
||||
|
auto focusedPeer = [self peer]->RootProvider_GetFocus(); |
||||
|
id focused = [AvnAccessibilityElement acquire:focusedPeer]; |
||||
|
|
||||
|
if (focused) |
||||
|
NSAccessibilityPostNotification(focused, NSAccessibilityFocusedUIElementChangedNotification); |
||||
|
|
||||
|
return self; |
||||
|
} |
||||
|
|
||||
|
- (AvnView *)ownerView |
||||
|
{ |
||||
|
return _owner; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityFocusedUIElement |
||||
|
{ |
||||
|
auto focusedPeer = [self peer]->RootProvider_GetFocus(); |
||||
|
return [AvnAccessibilityElement acquire:focusedPeer]; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityHitTest:(NSPoint)point |
||||
|
{ |
||||
|
auto clientPoint = [[_owner window] convertPointFromScreen:point]; |
||||
|
auto localPoint = [_owner translateLocalPoint:ToAvnPoint(clientPoint)]; |
||||
|
auto hit = [self peer]->RootProvider_GetPeerFromPoint(localPoint); |
||||
|
return [AvnAccessibilityElement acquire:hit]; |
||||
|
} |
||||
|
|
||||
|
- (id)accessibilityParent |
||||
|
{ |
||||
|
return _owner; |
||||
|
} |
||||
|
|
||||
|
- (void)raiseFocusChanged |
||||
|
{ |
||||
|
id focused = [self accessibilityFocusedUIElement]; |
||||
|
NSAccessibilityPostNotification(focused, NSAccessibilityFocusedUIElementChangedNotification); |
||||
|
} |
||||
|
|
||||
|
// Although this method is marked as deprecated we get runtime warnings if we don't handle it. |
||||
|
#pragma clang diagnostic push |
||||
|
#pragma clang diagnostic ignored "-Wdeprecated-implementations" |
||||
|
- (void)accessibilityPerformAction:(NSAccessibilityActionName)action |
||||
|
{ |
||||
|
[_owner accessibilityPerformAction:action]; |
||||
|
} |
||||
|
#pragma clang diagnostic pop |
||||
|
|
||||
|
@end |
||||
@ -1,19 +0,0 @@ |
|||||
Any raw assets you want to be deployed with your application can be placed in |
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset". |
|
||||
|
|
||||
These files will be deployed with you package and will be accessible using Android's |
|
||||
AssetManager, like this: |
|
||||
|
|
||||
public class ReadAsset : Activity |
|
||||
{ |
|
||||
protected override void OnCreate (Bundle bundle) |
|
||||
{ |
|
||||
base.OnCreate (bundle); |
|
||||
|
|
||||
InputStream input = Assets.Open ("my_asset.txt"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
Additionally, some Android functions will automatically load asset files: |
|
||||
|
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); |
|
||||
@ -1,165 +1,46 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
<TargetFramework>net6.0-android</TargetFramework> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> |
||||
<ProductVersion>8.0.30703</ProductVersion> |
<OutputType>Exe</OutputType> |
||||
<SchemaVersion>2.0</SchemaVersion> |
<Nullable>enable</Nullable> |
||||
<ProjectGuid>{29132311-1848-4FD6-AE0C-4FF841151BD3}</ProjectGuid> |
<ApplicationId>com.Avalonia.ControlCatalog</ApplicationId> |
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
<ApplicationVersion>1</ApplicationVersion> |
||||
<OutputType>Library</OutputType> |
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
<AndroidPackageFormat>apk</AndroidPackageFormat> |
||||
<RootNamespace>ControlCatalog.Android</RootNamespace> |
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver> |
||||
<AssemblyName>ControlCatalog.Android</AssemblyName> |
|
||||
<FileAlignment>512</FileAlignment> |
|
||||
<AndroidApplication>true</AndroidApplication> |
|
||||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile> |
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> |
|
||||
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk> |
|
||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion> |
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> |
|
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
||||
<DebugSymbols>True</DebugSymbols> |
|
||||
<DebugType>full</DebugType> |
|
||||
<Optimize>false</Optimize> |
|
||||
<OutputPath>bin\Debug\</OutputPath> |
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime> |
|
||||
<AndroidLinkMode>None</AndroidLinkMode> |
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
|
||||
<BundleAssemblies>False</BundleAssemblies> |
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi> |
|
||||
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64</AndroidSupportedAbis> |
|
||||
<Debugger>Xamarin</Debugger> |
|
||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex> |
|
||||
<AotAssemblies>False</AotAssemblies> |
|
||||
<EnableLLVM>False</EnableLLVM> |
|
||||
<EnableProguard>False</EnableProguard> |
|
||||
</PropertyGroup> |
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
||||
<DebugType>pdbonly</DebugType> |
|
||||
<Optimize>true</Optimize> |
|
||||
<OutputPath>bin\Release\</OutputPath> |
|
||||
<DefineConstants>TRACE</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime> |
|
||||
<AndroidLinkMode>Full</AndroidLinkMode> |
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
|
||||
<BundleAssemblies>False</BundleAssemblies> |
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi> |
|
||||
<AndroidSupportedAbis>armeabi-v7a,x86;x86_64</AndroidSupportedAbis> |
|
||||
<Debugger>Xamarin</Debugger> |
|
||||
<AotAssemblies>False</AotAssemblies> |
|
||||
<EnableLLVM>False</EnableLLVM> |
|
||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex> |
|
||||
<EnableProguard>False</EnableProguard> |
|
||||
<DebugSymbols>False</DebugSymbols> |
|
||||
</PropertyGroup> |
|
||||
<ItemGroup> |
|
||||
<Reference Include="Mono.Android" /> |
|
||||
<Reference Include="mscorlib" /> |
|
||||
<Reference Include="System" /> |
|
||||
<Reference Include="System.Core" /> |
|
||||
<Reference Include="System.Xml.Linq" /> |
|
||||
<Reference Include="System.Xml" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<Compile Include="MainActivity.cs" /> |
|
||||
<Compile Include="Resources\Resource.Designer.cs" /> |
|
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
||||
<Compile Include="SplashActivity.cs" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<None Include="Resources\AboutResources.txt" /> |
<None Remove="Assets\AboutAssets.txt" /> |
||||
<None Include="Assets\AboutAssets.txt" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<AndroidResource Include="Resources\drawable\splash_screen.xml" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<AndroidResource Include="Resources\values\colors.xml" /> |
|
||||
<AndroidResource Include="Resources\values\styles.xml" /> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<AndroidResource Include="..\..\build\Assets\Icon.png"> |
<AndroidResource Include="..\..\build\Assets\Icon.png"> |
||||
<Link>Resources\drawable\Icon.png</Link> |
<Link>Resources\drawable\Icon.png</Link> |
||||
</AndroidResource> |
</AndroidResource> |
||||
</ItemGroup> |
</ItemGroup> |
||||
|
|
||||
|
<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(TF_BUILD)' == ''"> |
||||
|
<DebugSymbols>True</DebugSymbols> |
||||
|
<RunAOTCompilation>False</RunAOTCompilation> |
||||
|
<EnableLLVM>True</EnableLLVM> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
||||
|
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk> |
||||
|
<RunAOTCompilation>False</RunAOTCompilation> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> |
||||
|
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
||||
|
</PropertyGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<None Include="Properties\AndroidManifest.xml" /> |
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.3" /> |
||||
|
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.3.1.3" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\..\src\Android\Avalonia.Android\Avalonia.Android.csproj"> |
<ProjectReference Include="..\..\src\Android\Avalonia.Android\Avalonia.Android.csproj" /> |
||||
<Project>{7B92AF71-6287-4693-9DCB-BD5B6E927E23}</Project> |
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" /> |
||||
<Name>Avalonia.Android</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Animation\Avalonia.Animation.csproj"> |
|
||||
<Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project> |
|
||||
<Name>Avalonia.Animation</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Base\Avalonia.Base.csproj"> |
|
||||
<Project>{b09b78d8-9b26-48b0-9149-d64a2f120f3f}</Project> |
|
||||
<Name>Avalonia.Base</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Controls\Avalonia.Controls.csproj"> |
|
||||
<Project>{d2221c82-4a25-4583-9b43-d791e3f6820c}</Project> |
|
||||
<Name>Avalonia.Controls</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj"> |
|
||||
<Project>{7062ae20-5dcc-4442-9645-8195bdece63e}</Project> |
|
||||
<Name>Avalonia.Diagnostics</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Input\Avalonia.Input.csproj"> |
|
||||
<Project>{62024b2d-53eb-4638-b26b-85eeaa54866e}</Project> |
|
||||
<Name>Avalonia.Input</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Interactivity\Avalonia.Interactivity.csproj"> |
|
||||
<Project>{6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b}</Project> |
|
||||
<Name>Avalonia.Interactivity</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Layout\Avalonia.Layout.csproj"> |
|
||||
<Project>{42472427-4774-4c81-8aff-9f27b8e31721}</Project> |
|
||||
<Name>Avalonia.Layout</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Themes.Fluent\Avalonia.Themes.Fluent.csproj"> |
|
||||
<Project>{c42d2fc1-a531-4ed4-84b9-89aec7c962fc}</Project> |
|
||||
<Name>Avalonia.Themes.Fluent</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Visuals\Avalonia.Visuals.csproj"> |
|
||||
<Project>{eb582467-6abb-43a1-b052-e981ba910e3a}</Project> |
|
||||
<Name>Avalonia.Visuals</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Styling\Avalonia.Styling.csproj"> |
|
||||
<Project>{f1baa01a-f176-4c6a-b39d-5b40bb1b148f}</Project> |
|
||||
<Name>Avalonia.Styling</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj"> |
|
||||
<Project>{3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f}</Project> |
|
||||
<Name>Avalonia.Themes.Default</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj"> |
|
||||
<Project>{3e53a01a-b331-47f3-b828-4a5717e77a24}</Project> |
|
||||
<Name>Avalonia.Markup.Xaml</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup\Avalonia.Markup.csproj"> |
|
||||
<Project>{6417e941-21bc-467b-a771-0de389353ce6}</Project> |
|
||||
<Name>Avalonia.Markup</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Skia\Avalonia.Skia\Avalonia.Skia.csproj"> |
|
||||
<Project>{7d2d3083-71dd-4cc9-8907-39a0d86fb322}</Project> |
|
||||
<Name>Avalonia.Skia</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj"> |
|
||||
<Project>{d0a739b9-3c68-4ba6-a328-41606954b6bd}</Project> |
|
||||
<Name>ControlCatalog</Name> |
|
||||
</ProjectReference> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="..\..\build\Rx.props" /> |
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
|
||||
<Import Project="..\..\build\AndroidWorkarounds.props" /> |
|
||||
<Import Project="..\..\build\LegacyProject.targets" /> |
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,5 +1,4 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ControlCatalog.Android" android:versionCode="1" android:versionName="1.0" android:installLocation="auto"> |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto"> |
||||
<uses-sdk android:targetSdkVersion="30" /> |
<application android:label="ControlCatalog.Android" android:icon="@drawable/Icon"></application> |
||||
<application android:label="ControlCatalog.Android"></application> |
</manifest> |
||||
</manifest> |
|
||||
|
|||||
@ -1,30 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
using System.Runtime.CompilerServices; |
|
||||
using System.Runtime.InteropServices; |
|
||||
using Android.App; |
|
||||
|
|
||||
// General Information about an assembly is controlled through the following
|
|
||||
// set of attributes. Change these attribute values to modify the information
|
|
||||
// associated with an assembly.
|
|
||||
[assembly: AssemblyTitle("ControlCatalog.Android")] |
|
||||
[assembly: AssemblyDescription("")] |
|
||||
[assembly: AssemblyConfiguration("")] |
|
||||
[assembly: AssemblyCompany("")] |
|
||||
[assembly: AssemblyProduct("ControlCatalog.Android")] |
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")] |
|
||||
[assembly: AssemblyTrademark("")] |
|
||||
[assembly: AssemblyCulture("")] |
|
||||
[assembly: ComVisible(false)] |
|
||||
|
|
||||
// Version information for an assembly consists of the following four values:
|
|
||||
//
|
|
||||
// Major Version
|
|
||||
// Minor Version
|
|
||||
// Build Number
|
|
||||
// Revision
|
|
||||
//
|
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||
// by using the '*' as shown below:
|
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||
[assembly: AssemblyVersion("1.0.0.0")] |
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|
||||
@ -1,101 +0,0 @@ |
|||||
#pragma warning disable 1591
|
|
||||
//------------------------------------------------------------------------------
|
|
||||
// <auto-generated>
|
|
||||
// This code was generated by a tool.
|
|
||||
//
|
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||
// the code is regenerated.
|
|
||||
// </auto-generated>
|
|
||||
//------------------------------------------------------------------------------
|
|
||||
|
|
||||
[assembly: global::Android.Runtime.ResourceDesignerAttribute("ControlCatalog.Android.Resource", IsApplication=true)] |
|
||||
|
|
||||
namespace ControlCatalog.Android |
|
||||
{ |
|
||||
|
|
||||
|
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.99.62")] |
|
||||
public partial class Resource |
|
||||
{ |
|
||||
|
|
||||
static Resource() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
public static void UpdateIdValues() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public partial class Attribute |
|
||||
{ |
|
||||
|
|
||||
static Attribute() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Attribute() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class Color |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F010000
|
|
||||
public const int splash_background = 2130771968; |
|
||||
|
|
||||
static Color() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Color() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class Drawable |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F020000
|
|
||||
public const int Icon = 2130837504; |
|
||||
|
|
||||
// aapt resource value: 0x7F020001
|
|
||||
public const int splash_screen = 2130837505; |
|
||||
|
|
||||
static Drawable() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Drawable() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class Style |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F030000
|
|
||||
public const int MyTheme = 2130903040; |
|
||||
|
|
||||
// aapt resource value: 0x7F030001
|
|
||||
public const int MyTheme_NoActionBar = 2130903041; |
|
||||
|
|
||||
// aapt resource value: 0x7F030002
|
|
||||
public const int MyTheme_Splash = 2130903042; |
|
||||
|
|
||||
static Style() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Style() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
#pragma warning restore 1591
|
|
||||
@ -0,0 +1,7 @@ |
|||||
|
<Directives> |
||||
|
<Application> |
||||
|
<Assembly Name="ControlCatalog" Dynamic="Required All"></Assembly> |
||||
|
<Assembly Name="Avalonia.Themes.Default" Dynamic="Required All"></Assembly> |
||||
|
<Assembly Name="Avalonia.Themes.Fluent" Dynamic="Required All"></Assembly> |
||||
|
</Application> |
||||
|
</Directives> |
||||
@ -0,0 +1,15 @@ |
|||||
|
using Avalonia.iOS; |
||||
|
using Foundation; |
||||
|
using UIKit; |
||||
|
|
||||
|
namespace ControlCatalog.iOS.Legacy |
||||
|
{ |
||||
|
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
|
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
|
// application events from iOS.
|
||||
|
[Register("AppDelegate")] |
||||
|
public partial class AppDelegate : AvaloniaAppDelegate<App> |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,117 @@ |
|||||
|
{ |
||||
|
"images": [ |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "20x20", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon40.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "3x", |
||||
|
"size": "20x20", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon60.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "29x29", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon58.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "3x", |
||||
|
"size": "29x29", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon87.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "40x40", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon80.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "3x", |
||||
|
"size": "40x40", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon120.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "60x60", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon120.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "3x", |
||||
|
"size": "60x60", |
||||
|
"idiom": "iphone", |
||||
|
"filename": "Icon180.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "1x", |
||||
|
"size": "20x20", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon20.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "20x20", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon40.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "1x", |
||||
|
"size": "29x29", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon29.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "29x29", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon58.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "1x", |
||||
|
"size": "40x40", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon40.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "40x40", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon80.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "1x", |
||||
|
"size": "76x76", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon76.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "76x76", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon152.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "2x", |
||||
|
"size": "83.5x83.5", |
||||
|
"idiom": "ipad", |
||||
|
"filename": "Icon167.png" |
||||
|
}, |
||||
|
{ |
||||
|
"scale": "1x", |
||||
|
"size": "1024x1024", |
||||
|
"idiom": "ios-marketing", |
||||
|
"filename": "Icon1024.png" |
||||
|
} |
||||
|
], |
||||
|
"properties": {}, |
||||
|
"info": { |
||||
|
"version": 1, |
||||
|
"author": "xcode" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,99 @@ |
|||||
|
<Project Sdk="Xamarin.Legacy.Sdk"> |
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>xamarin.ios10</TargetFramework> |
||||
|
<SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion> |
||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
|
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform> |
||||
|
<ProjectGuid>{3AF75F00-B497-4517-9491-922173DE216E}</ProjectGuid> |
||||
|
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
||||
|
<OutputType>Exe</OutputType> |
||||
|
<RootNamespace>ControlCatalog.iOS.Legacy</RootNamespace> |
||||
|
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix> |
||||
|
<AssemblyName>ControlCatalog.iOS.Legacy</AssemblyName> |
||||
|
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler> |
||||
|
<ProvisioningType>manual</ProvisioningType> |
||||
|
<MtouchInterpreter>-all</MtouchInterpreter> |
||||
|
</PropertyGroup> |
||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' "> |
||||
|
<DebugSymbols>true</DebugSymbols> |
||||
|
<DebugType>full</DebugType> |
||||
|
<Optimize>false</Optimize> |
||||
|
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath> |
||||
|
<DefineConstants>DEBUG</DefineConstants> |
||||
|
<ErrorReport>prompt</ErrorReport> |
||||
|
<WarningLevel>4</WarningLevel> |
||||
|
<ConsolePause>false</ConsolePause> |
||||
|
<MtouchArch>x86_64</MtouchArch> |
||||
|
<MtouchLink>None</MtouchLink> |
||||
|
<MtouchDebug>true</MtouchDebug> |
||||
|
</PropertyGroup> |
||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> |
||||
|
<DebugType>none</DebugType> |
||||
|
<Optimize>true</Optimize> |
||||
|
<OutputPath>bin\iPhoneSimulator\Release</OutputPath> |
||||
|
<ErrorReport>prompt</ErrorReport> |
||||
|
<WarningLevel>4</WarningLevel> |
||||
|
<MtouchLink>None</MtouchLink> |
||||
|
<MtouchArch>x86_64</MtouchArch> |
||||
|
<ConsolePause>false</ConsolePause> |
||||
|
</PropertyGroup> |
||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "> |
||||
|
<DebugSymbols>true</DebugSymbols> |
||||
|
<DebugType>full</DebugType> |
||||
|
<Optimize>false</Optimize> |
||||
|
<OutputPath>bin\iPhone\Debug</OutputPath> |
||||
|
<DefineConstants>DEBUG</DefineConstants> |
||||
|
<ErrorReport>prompt</ErrorReport> |
||||
|
<WarningLevel>4</WarningLevel> |
||||
|
<ConsolePause>false</ConsolePause> |
||||
|
<MtouchArch>ARM64</MtouchArch> |
||||
|
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
||||
|
<MtouchDebug>true</MtouchDebug> |
||||
|
</PropertyGroup> |
||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
||||
|
<DebugType>none</DebugType> |
||||
|
<Optimize>true</Optimize> |
||||
|
<OutputPath>bin\iPhone\Release</OutputPath> |
||||
|
<ErrorReport>prompt</ErrorReport> |
||||
|
<WarningLevel>4</WarningLevel> |
||||
|
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
||||
|
<MtouchArch>ARM64</MtouchArch> |
||||
|
<ConsolePause>false</ConsolePause> |
||||
|
</PropertyGroup> |
||||
|
<ItemGroup> |
||||
|
<None Include="Info.plist" /> |
||||
|
<Content Include="Entitlements.plist" /> |
||||
|
</ItemGroup> |
||||
|
<ItemGroup> |
||||
|
<Reference Include="System" /> |
||||
|
<Reference Include="System.Xml" /> |
||||
|
<Reference Include="System.Core" /> |
||||
|
<Reference Include="Xamarin.iOS" /> |
||||
|
</ItemGroup> |
||||
|
<ItemGroup> |
||||
|
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json"> |
||||
|
<Visible>false</Visible> |
||||
|
</ImageAsset> |
||||
|
</ItemGroup> |
||||
|
<ItemGroup> |
||||
|
<Folder Include="Resources\" /> |
||||
|
</ItemGroup> |
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\src\Avalonia.Controls\Avalonia.Controls.csproj"> |
||||
|
<Project>{d2221c82-4a25-4583-9b43-d791e3f6820c}</Project> |
||||
|
<Name>Avalonia.Controls</Name> |
||||
|
</ProjectReference> |
||||
|
<ProjectReference Include="..\..\src\iOS\Avalonia.iOS\Avalonia.iOS.csproj"> |
||||
|
<Project>{4488ad85-1495-4809-9aa4-ddfe0a48527e}</Project> |
||||
|
<Name>Avalonia.iOS</Name> |
||||
|
</ProjectReference> |
||||
|
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj"> |
||||
|
<Project>{d0a739b9-3c68-4ba6-a328-41606954b6bd}</Project> |
||||
|
<Name>ControlCatalog</Name> |
||||
|
</ProjectReference> |
||||
|
</ItemGroup> |
||||
|
<!-- <Import Project="..\..\build\LegacyProject.targets" />--> |
||||
|
<!-- <Import Project="..\..\build\SkiaSharp.props" />--> |
||||
|
<!-- <Import Project="..\..\build\HarfBuzzSharp.props" />--> |
||||
|
</Project> |
||||
@ -0,0 +1,6 @@ |
|||||
|
<?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> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,47 @@ |
|||||
|
<?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>CFBundleDisplayName</key> |
||||
|
<string>ControlCatalog</string> |
||||
|
<key>CFBundleIdentifier</key> |
||||
|
<string>com.companyname.ControlCatalog.iOS</string> |
||||
|
<key>CFBundleShortVersionString</key> |
||||
|
<string>1.0</string> |
||||
|
<key>CFBundleVersion</key> |
||||
|
<string>1.0</string> |
||||
|
<key>LSRequiresIPhoneOS</key> |
||||
|
<true/> |
||||
|
<key>MinimumOSVersion</key> |
||||
|
<string>15.0</string> |
||||
|
<key>UIDeviceFamily</key> |
||||
|
<array> |
||||
|
<integer>1</integer><integer>2</integer> |
||||
|
</array> |
||||
|
<key>UILaunchStoryboardName</key> |
||||
|
<string>LaunchScreen</string> |
||||
|
<key>UIRequiredDeviceCapabilities</key> |
||||
|
<array> |
||||
|
<string>armv7</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> |
||||
|
<key>UIStatusBarHidden</key> |
||||
|
<true/> |
||||
|
<key>UIViewControllerBasedStatusBarAppearance</key> |
||||
|
<false/> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,15 @@ |
|||||
|
using UIKit; |
||||
|
|
||||
|
namespace ControlCatalog.iOS.Legacy |
||||
|
{ |
||||
|
public class Application |
||||
|
{ |
||||
|
// This is the main entry point of the application.
|
||||
|
static void Main(string[] args) |
||||
|
{ |
||||
|
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
|
// you can specify it here.
|
||||
|
UIApplication.Main(args, null, "AppDelegate"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> |
||||
|
<dependencies> |
||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207" /> |
||||
|
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1" /> |
||||
|
</dependencies> |
||||
|
<objects> |
||||
|
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" /> |
||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder" /> |
||||
|
<view contentMode="scaleToFill" id="iN0-l3-epB"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="480" height="480" /> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" /> |
||||
|
<subviews> |
||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2022 " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" |
||||
|
minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> |
||||
|
<rect key="frame" x="20" y="439" width="441" height="21" /> |
||||
|
<fontDescription key="fontDescription" type="system" pointSize="17" /> |
||||
|
<color key="textColor" cocoaTouchSystemColor="darkTextColor" /> |
||||
|
<nil key="highlightedColor" /> |
||||
|
</label> |
||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ControlCatalog.iOS.Legacy" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" |
||||
|
minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> |
||||
|
<rect key="frame" x="20" y="140" width="441" height="43" /> |
||||
|
<fontDescription key="fontDescription" type="boldSystem" pointSize="36" /> |
||||
|
<color key="textColor" cocoaTouchSystemColor="darkTextColor" /> |
||||
|
<nil key="highlightedColor" /> |
||||
|
</label> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" /> |
||||
|
<constraints> |
||||
|
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC" /> |
||||
|
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk" /> |
||||
|
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l" /> |
||||
|
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0" /> |
||||
|
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9" /> |
||||
|
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g" /> |
||||
|
</constraints> |
||||
|
<nil key="simulatedStatusBarMetrics" /> |
||||
|
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics" /> |
||||
|
<point key="canvasLocation" x="548" y="455" /> |
||||
|
</view> |
||||
|
</objects> |
||||
|
</document> |
||||
@ -1,186 +1,16 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform> |
|
||||
<ProjectGuid>{57E0455D-D565-44BB-B069-EE1AA20F8337}</ProjectGuid> |
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
|
||||
<OutputType>Exe</OutputType> |
<OutputType>Exe</OutputType> |
||||
<RootNamespace>ControlCatalog.iOS</RootNamespace> |
<ProvisioningType>manual</ProvisioningType> |
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix> |
<TargetFramework>net6.0-ios</TargetFramework> |
||||
<AssemblyName>ControlCatalogiOS</AssemblyName> |
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion> |
||||
<MtouchEnableSGenConc>true</MtouchEnableSGenConc> |
<!-- temporal workaround for our GL interface backend --> |
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler> |
<UseInterpreter>True</UseInterpreter> |
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle> |
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier> |
||||
<ProvisioningType>automatic</ProvisioningType> |
<!-- <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>--> |
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' "> |
|
||||
<DebugSymbols>true</DebugSymbols> |
|
||||
<DebugType>full</DebugType> |
|
||||
<Optimize>false</Optimize> |
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath> |
|
||||
<DefineConstants>DEBUG</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<ConsolePause>false</ConsolePause> |
|
||||
<MtouchArch>x86_64</MtouchArch> |
|
||||
<MtouchLink>None</MtouchLink> |
|
||||
<MtouchDebug>True</MtouchDebug> |
|
||||
<MtouchSdkVersion>9.1</MtouchSdkVersion> |
|
||||
<MtouchProfiling>False</MtouchProfiling> |
|
||||
<MtouchFastDev>False</MtouchFastDev> |
|
||||
<MtouchNoSymbolStrip>False</MtouchNoSymbolStrip> |
|
||||
<MtouchUseLlvm>False</MtouchUseLlvm> |
|
||||
<MtouchUseThumb>False</MtouchUseThumb> |
|
||||
<MtouchEnableBitcode>False</MtouchEnableBitcode> |
|
||||
<MtouchUseSGen>False</MtouchUseSGen> |
|
||||
<MtouchUseRefCounting>False</MtouchUseRefCounting> |
|
||||
<OptimizePNGs>True</OptimizePNGs> |
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider> |
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler> |
|
||||
<MtouchFloat32>False</MtouchFloat32> |
|
||||
</PropertyGroup> |
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> |
|
||||
<DebugType>none</DebugType> |
|
||||
<Optimize>true</Optimize> |
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<MtouchLink>None</MtouchLink> |
|
||||
<MtouchArch>x86_64</MtouchArch> |
|
||||
<ConsolePause>false</ConsolePause> |
|
||||
</PropertyGroup> |
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "> |
|
||||
<DebugSymbols>true</DebugSymbols> |
|
||||
<DebugType>full</DebugType> |
|
||||
<Optimize>false</Optimize> |
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath> |
|
||||
<DefineConstants>DEBUG</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<ConsolePause>false</ConsolePause> |
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch> |
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
|
||||
<CodesignKey>iPhone Developer</CodesignKey> |
|
||||
<MtouchDebug>true</MtouchDebug> |
|
||||
</PropertyGroup> |
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
|
||||
<DebugType>none</DebugType> |
|
||||
<Optimize>true</Optimize> |
|
||||
<OutputPath>bin\iPhone\Release</OutputPath> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch> |
|
||||
<ConsolePause>false</ConsolePause> |
|
||||
<CodesignKey>iPhone Developer</CodesignKey> |
|
||||
</PropertyGroup> |
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' "> |
|
||||
<DebugType>none</DebugType> |
|
||||
<Optimize>True</Optimize> |
|
||||
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<ConsolePause>False</ConsolePause> |
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch> |
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
|
||||
<BuildIpa>True</BuildIpa> |
|
||||
<CodesignProvision>Automatic:AdHoc</CodesignProvision> |
|
||||
<CodesignKey>iPhone Distribution</CodesignKey> |
|
||||
</PropertyGroup> |
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' "> |
|
||||
<DebugType>none</DebugType> |
|
||||
<Optimize>True</Optimize> |
|
||||
<OutputPath>bin\iPhone\AppStore</OutputPath> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<ConsolePause>False</ConsolePause> |
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch> |
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
|
||||
<CodesignProvision>Automatic:AppStore</CodesignProvision> |
|
||||
<CodesignKey>iPhone Distribution</CodesignKey> |
|
||||
</PropertyGroup> |
|
||||
<ItemGroup> |
|
||||
<Compile Include="Main.cs" /> |
|
||||
<Compile Include="AppDelegate.cs" /> |
|
||||
<None Include="Info.plist" /> |
|
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
||||
<InterfaceDefinition Include="Resources\LaunchScreen.xib" /> |
|
||||
<Content Include="Entitlements.plist" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<Reference Include="System" /> |
|
||||
<Reference Include="System.Xml" /> |
|
||||
<Reference Include="System.Core" /> |
|
||||
<Reference Include="Xamarin.iOS" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\..\src\iOS\Avalonia.iOS\Avalonia.iOS.csproj"> |
<ProjectReference Include="..\..\src\iOS\Avalonia.iOS\Avalonia.iOS.csproj" /> |
||||
<Project>{4488AD85-1495-4809-9AA4-DDFE0A48527E}</Project> |
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" /> |
||||
<Name>Avalonia.iOS</Name> |
|
||||
<IsAppExtension>false</IsAppExtension> |
|
||||
<IsWatchApp>false</IsWatchApp> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj"> |
|
||||
<Project>{3E53A01A-B331-47F3-B828-4A5717E77A24}</Project> |
|
||||
<Name>Avalonia.Markup.Xaml</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup\Avalonia.Markup.csproj"> |
|
||||
<Project>{6417E941-21BC-467B-A771-0DE389353CE6}</Project> |
|
||||
<Name>Avalonia.Markup</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Animation\Avalonia.Animation.csproj"> |
|
||||
<Project>{D211E587-D8BC-45B9-95A4-F297C8FA5200}</Project> |
|
||||
<Name>Avalonia.Animation</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Base\Avalonia.Base.csproj"> |
|
||||
<Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project> |
|
||||
<Name>Avalonia.Base</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Controls\Avalonia.Controls.csproj"> |
|
||||
<Project>{D2221C82-4A25-4583-9B43-D791E3F6820C}</Project> |
|
||||
<Name>Avalonia.Controls</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj"> |
|
||||
<Project>{7062AE20-5DCC-4442-9645-8195BDECE63E}</Project> |
|
||||
<Name>Avalonia.Diagnostics</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Input\Avalonia.Input.csproj"> |
|
||||
<Project>{62024B2D-53EB-4638-B26B-85EEAA54866E}</Project> |
|
||||
<Name>Avalonia.Input</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Interactivity\Avalonia.Interactivity.csproj"> |
|
||||
<Project>{6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B}</Project> |
|
||||
<Name>Avalonia.Interactivity</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Layout\Avalonia.Layout.csproj"> |
|
||||
<Project>{42472427-4774-4C81-8AFF-9F27B8E31721}</Project> |
|
||||
<Name>Avalonia.Layout</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Visuals\Avalonia.Visuals.csproj"> |
|
||||
<Project>{EB582467-6ABB-43A1-B052-E981BA910E3A}</Project> |
|
||||
<Name>Avalonia.Visuals</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Styling\Avalonia.Styling.csproj"> |
|
||||
<Project>{F1BAA01A-F176-4C6A-B39D-5B40BB1B148F}</Project> |
|
||||
<Name>Avalonia.Styling</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj"> |
|
||||
<Project>{3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F}</Project> |
|
||||
<Name>Avalonia.Themes.Default</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Skia\Avalonia.Skia\Avalonia.Skia.csproj"> |
|
||||
<Project>{7d2d3083-71dd-4cc9-8907-39a0d86fb322}</Project> |
|
||||
<Name>Avalonia.Skia</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj"> |
|
||||
<Project>{d0a739b9-3c68-4ba6-a328-41606954b6bd}</Project> |
|
||||
<Name>ControlCatalog</Name> |
|
||||
</ProjectReference> |
|
||||
<PackageReference Include="SkiaSharp.HarfBuzz" Version="2.80.2-preview.33" /> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> |
|
||||
<Import Project="..\..\build\LegacyProject.targets" /> |
|
||||
<Import Project="..\..\build\SkiaSharp.props" /> |
|
||||
<Import Project="..\..\build\HarfBuzzSharp.props" /> |
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,36 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
using System.Runtime.CompilerServices; |
|
||||
using System.Runtime.InteropServices; |
|
||||
|
|
||||
// General Information about an assembly is controlled through the following
|
|
||||
// set of attributes. Change these attribute values to modify the information
|
|
||||
// associated with an assembly.
|
|
||||
[assembly: AssemblyTitle("ControlCatalog.iOS")] |
|
||||
[assembly: AssemblyDescription("")] |
|
||||
[assembly: AssemblyConfiguration("")] |
|
||||
[assembly: AssemblyCompany("")] |
|
||||
[assembly: AssemblyProduct("ControlCatalog.iOS")] |
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")] |
|
||||
[assembly: AssemblyTrademark("")] |
|
||||
[assembly: AssemblyCulture("")] |
|
||||
|
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||
// to COM components. If you need to access a type in this assembly from
|
|
||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||
[assembly: ComVisible(false)] |
|
||||
|
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||
[assembly: Guid("57e0455d-d565-44bb-b069-ee1aa20f8337")] |
|
||||
|
|
||||
// Version information for an assembly consists of the following four values:
|
|
||||
//
|
|
||||
// Major Version
|
|
||||
// Minor Version
|
|
||||
// Build Number
|
|
||||
// Revision
|
|
||||
//
|
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||
// by using the '*' as shown below:
|
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||
[assembly: AssemblyVersion("1.0.0.0")] |
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|
||||
@ -1,45 +0,0 @@ |
|||||
<UserControl xmlns="https://github.com/avaloniaui" |
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
||||
x:Class="ControlCatalog.Pages.ButtonPage"> |
|
||||
<StackPanel Orientation="Vertical" Spacing="4"> |
|
||||
<TextBlock Classes="h2">A button control</TextBlock> |
|
||||
|
|
||||
<StackPanel Orientation="Horizontal" |
|
||||
Margin="0,16,0,0" |
|
||||
HorizontalAlignment="Center" |
|
||||
Spacing="16"> |
|
||||
<StackPanel Orientation="Vertical" Spacing="8" Width="200"> |
|
||||
<Button>Standard _XAML Button</Button> |
|
||||
<Button Foreground="White">Foreground</Button> |
|
||||
<Button Background="{DynamicResource SystemAccentColor}">Background</Button> |
|
||||
<Button IsEnabled="False">Disabled</Button> |
|
||||
<Button Content="Re-themed"> |
|
||||
<Button.Styles> |
|
||||
<Style> |
|
||||
<Style.Resources> |
|
||||
<SolidColorBrush x:Key="ThemeBorderMidBrush">Red</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ThemeControlHighBrush">DarkRed</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBorderBrush">Red</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBackground">DarkRed</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">Red</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed">OrangeRed</SolidColorBrush> |
|
||||
</Style.Resources> |
|
||||
</Style> |
|
||||
</Button.Styles> |
|
||||
</Button> |
|
||||
<RepeatButton Name="RepeatButton"> |
|
||||
<TextBlock Name="RepeatButtonTextBlock" Text="Repeat Button: 0" /> |
|
||||
</RepeatButton> |
|
||||
<ToggleButton Content="Toggle Button"/> |
|
||||
</StackPanel> |
|
||||
|
|
||||
<StackPanel Orientation="Vertical" Spacing="8" Width="150"> |
|
||||
<Button BorderThickness="0">No Border</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}">Border Color</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4">Thick Border</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4" IsEnabled="False">Disabled</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}" KeyboardNavigation.IsTabStop="False">IsTabStop=False</Button> |
|
||||
</StackPanel> |
|
||||
</StackPanel> |
|
||||
</StackPanel> |
|
||||
</UserControl> |
|
||||
@ -0,0 +1,224 @@ |
|||||
|
<UserControl xmlns="https://github.com/avaloniaui" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
x:Class="ControlCatalog.Pages.ButtonsPage"> |
||||
|
|
||||
|
<UserControl.Resources> |
||||
|
|
||||
|
<MenuFlyout x:Key="SharedMenuFlyout" |
||||
|
Placement="Bottom"> |
||||
|
<MenuItem Header="Item 1"> |
||||
|
<MenuItem Header="Subitem 1" /> |
||||
|
<MenuItem Header="Subitem 2" /> |
||||
|
<MenuItem Header="Subitem 3" /> |
||||
|
</MenuItem> |
||||
|
<MenuItem Header="Item 2" |
||||
|
InputGesture="Ctrl+A" /> |
||||
|
<MenuItem Header="Item 3" /> |
||||
|
</MenuFlyout> |
||||
|
|
||||
|
</UserControl.Resources> |
||||
|
|
||||
|
<UserControl.Styles > |
||||
|
|
||||
|
<Style Selector="Border.header-border"> |
||||
|
<Setter Property="Background"> |
||||
|
<Setter.Value> |
||||
|
<SolidColorBrush Color="Gray" Opacity="0.5" /> |
||||
|
</Setter.Value> |
||||
|
</Setter> |
||||
|
<Setter Property="BorderBrush" Value="Gray" /> |
||||
|
<Setter Property="BorderThickness" Value="0.5" /> |
||||
|
<Setter Property="CornerRadius" Value="5,5,0,0" /> |
||||
|
<Setter Property="MaxWidth" Value="450" /> |
||||
|
<Setter Property="Padding" Value="10" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="TextBlock.header"> |
||||
|
<Setter Property="FontSize" Value="18" /> |
||||
|
<Setter Property="FontWeight" Value="Bold" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="Border.thin"> |
||||
|
<Setter Property="BorderBrush" Value="Gray" /> |
||||
|
<Setter Property="BorderThickness" Value="0.5" /> |
||||
|
<Setter Property="CornerRadius" Value="0,0,5,5" /> |
||||
|
<Setter Property="Margin" Value="0,0,0,15" /> |
||||
|
</Style> |
||||
|
|
||||
|
</UserControl.Styles> |
||||
|
|
||||
|
<!-- Styles and overall page design based on AcrylicPage --> |
||||
|
|
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Width="450"> |
||||
|
|
||||
|
<!-- Button --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="Button" Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A standard button control</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Horizontal" |
||||
|
HorizontalAlignment="Center" |
||||
|
Spacing="10"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8" |
||||
|
Width="200"> |
||||
|
<Button>Standard _XAML Button</Button> |
||||
|
<Button Foreground="White">Foreground</Button> |
||||
|
<Button Background="{DynamicResource SystemAccentColor}">Background</Button> |
||||
|
<Button IsEnabled="False">Disabled</Button> |
||||
|
<Button Content="Re-themed"> |
||||
|
<Button.Styles> |
||||
|
<Style> |
||||
|
<Style.Resources> |
||||
|
<SolidColorBrush x:Key="ThemeBorderMidBrush">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ThemeControlHighBrush">DarkRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBorderBrush">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBackground">DarkRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBackgroundPressed">OrangeRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonForeground">White</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonForegroundPointerOver">Black</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonForegroundPressed">Black</SolidColorBrush> |
||||
|
</Style.Resources> |
||||
|
</Style> |
||||
|
</Button.Styles> |
||||
|
</Button> |
||||
|
</StackPanel> |
||||
|
|
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8" |
||||
|
Width="200"> |
||||
|
<Button BorderThickness="0">No Border</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}">Border Color</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}" |
||||
|
BorderThickness="4">Thick Border</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}" |
||||
|
BorderThickness="4" |
||||
|
IsEnabled="False">Disabled</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}" |
||||
|
KeyboardNavigation.IsTabStop="False">IsTabStop=False</Button> |
||||
|
</StackPanel> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- ToggleButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="ToggleButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button control with multiple states: checked, unchecked or indeterminate.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<ToggleButton Content="Toggle Button" /> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- RepeatButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="RepeatButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button control that raises its Click event repeatedly when it is pressed and held.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<RepeatButton Name="RepeatButton"> |
||||
|
<TextBlock Name="RepeatButtonTextBlock" |
||||
|
Text="Repeat Button: 0" /> |
||||
|
</RepeatButton> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- SplitButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="SplitButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button with primary and secondary parts that can each be pressed separately. The primary part behaves like a Button and the secondary part opens a flyout.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<SplitButton Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Content" /> |
||||
|
</SplitButton> |
||||
|
<SplitButton IsEnabled="False" |
||||
|
Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Disabled" /> |
||||
|
</SplitButton> |
||||
|
<SplitButton Flyout="{StaticResource SharedMenuFlyout}" |
||||
|
Content="Re-themed"> |
||||
|
<SplitButton.Styles> |
||||
|
<Style> |
||||
|
<Style.Resources> |
||||
|
<x:Double x:Key="SplitButtonSeparatorWidth">1.5</x:Double> |
||||
|
<Thickness x:Key="SplitButtonBorderThemeThickness">2</Thickness> |
||||
|
<SolidColorBrush x:Key="SplitButtonBorderBrush">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBorderBrushPointerOver">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBorderBrushPressed">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBackground">DarkRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBackgroundPointerOver">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBackgroundPressed">OrangeRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonForeground">White</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonForegroundPointerOver">Black</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonForegroundPressed">Black</SolidColorBrush> |
||||
|
</Style.Resources> |
||||
|
</Style> |
||||
|
</SplitButton.Styles> |
||||
|
</SplitButton> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- ToggleSplitButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="ToggleSplitButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button with primary and secondary parts that can each be pressed separately. The primary part behaves like a ToggleButton with two states and the secondary part opens a flyout.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<ToggleSplitButton Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Content" /> |
||||
|
</ToggleSplitButton> |
||||
|
<ToggleSplitButton IsChecked="True" |
||||
|
Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Content" /> |
||||
|
</ToggleSplitButton> |
||||
|
<ToggleSplitButton IsChecked="True" |
||||
|
IsEnabled="False" |
||||
|
Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Disabled" /> |
||||
|
</ToggleSplitButton> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
</StackPanel> |
||||
|
</UserControl> |
||||
@ -0,0 +1,23 @@ |
|||||
|
<UserControl x:Class="ControlCatalog.Pages.ClipboardPage" |
||||
|
xmlns="https://github.com/avaloniaui" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
|
<StackPanel Orientation="Vertical" Spacing="4"> |
||||
|
<TextBlock Classes="h2">Example of ClipboardPage capabilities</TextBlock> |
||||
|
|
||||
|
<Button Click="CopyText" Content="Copy text to clipboard" /> |
||||
|
<Button Click="PasteText" Content="Paste text from clipboard" /> |
||||
|
<Button Click="CopyTextDataObject" Content="Copy text to clipboard (data object)" /> |
||||
|
<Button Click="PasteTextDataObject" Content="Paste text from clipboard (data object)" /> |
||||
|
|
||||
|
<Button Click="CopyFilesDataObject" Content="Copy files to clipboard (data object)" /> |
||||
|
<Button Click="PasteFilesDataObject" Content="Paste files from clipboard (data object)" /> |
||||
|
|
||||
|
<Button Click="GetFormats" Content="Get clipboard formats" /> |
||||
|
<Button Click="Clear" Content="Clear clipboard" /> |
||||
|
|
||||
|
<TextBox x:Name="ClipboardContent" |
||||
|
MinHeight="100" |
||||
|
AcceptsReturn="True" |
||||
|
Watermark="Text to copy of file names per line" /> |
||||
|
</StackPanel> |
||||
|
</UserControl> |
||||
@ -0,0 +1,77 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
using Avalonia; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Input; |
||||
|
using Avalonia.Interactivity; |
||||
|
using Avalonia.Markup.Xaml; |
||||
|
|
||||
|
namespace ControlCatalog.Pages |
||||
|
{ |
||||
|
public partial class ClipboardPage : UserControl |
||||
|
{ |
||||
|
public ClipboardPage() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private TextBox ClipboardContent => this.Get<TextBox>("ClipboardContent"); |
||||
|
|
||||
|
private void InitializeComponent() |
||||
|
{ |
||||
|
AvaloniaXamlLoader.Load(this); |
||||
|
} |
||||
|
|
||||
|
private async void CopyText(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
await Application.Current.Clipboard.SetTextAsync(ClipboardContent.Text); |
||||
|
} |
||||
|
|
||||
|
private async void PasteText(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
ClipboardContent.Text = await Application.Current.Clipboard.GetTextAsync(); |
||||
|
} |
||||
|
|
||||
|
private async void CopyTextDataObject(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
var dataObject = new DataObject(); |
||||
|
dataObject.Set(DataFormats.Text, ClipboardContent.Text ?? string.Empty); |
||||
|
await Application.Current.Clipboard.SetDataObjectAsync(dataObject); |
||||
|
} |
||||
|
|
||||
|
private async void PasteTextDataObject(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
ClipboardContent.Text = await Application.Current.Clipboard.GetDataAsync(DataFormats.Text) as string ?? string.Empty; |
||||
|
} |
||||
|
|
||||
|
private async void CopyFilesDataObject(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
var files = ClipboardContent.Text.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); |
||||
|
if (files.Length == 0) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
var dataObject = new DataObject(); |
||||
|
dataObject.Set(DataFormats.FileNames, files); |
||||
|
await Application.Current.Clipboard.SetDataObjectAsync(dataObject); |
||||
|
} |
||||
|
|
||||
|
private async void PasteFilesDataObject(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
var fiels = await Application.Current.Clipboard.GetDataAsync(DataFormats.FileNames) as IEnumerable<string>; |
||||
|
ClipboardContent.Text = fiels != null ? string.Join(Environment.NewLine, fiels) : string.Empty; |
||||
|
} |
||||
|
|
||||
|
private async void GetFormats(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
var formats = await Application.Current.Clipboard.GetFormatsAsync(); |
||||
|
ClipboardContent.Text = string.Join(Environment.NewLine, formats); |
||||
|
} |
||||
|
|
||||
|
private async void Clear(object sender, RoutedEventArgs args) |
||||
|
{ |
||||
|
await Application.Current.Clipboard.ClearAsync(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,77 +1,95 @@ |
|||||
<UserControl xmlns="https://github.com/avaloniaui" |
<UserControl |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
x:Class="ControlCatalog.Pages.ComboBoxPage" |
||||
x:Class="ControlCatalog.Pages.ComboBoxPage" |
xmlns="https://github.com/avaloniaui" |
||||
xmlns:sys="using:System" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:col="using:System.Collections"> |
xmlns:col="using:System.Collections" |
||||
<StackPanel Orientation="Vertical" Spacing="4"> |
xmlns:sys="using:System"> |
||||
<TextBlock Classes="h2">A drop-down list.</TextBlock> |
<StackPanel Orientation="Vertical" Spacing="4"> |
||||
|
<TextBlock Classes="h2">A drop-down list.</TextBlock> |
||||
|
|
||||
<WrapPanel HorizontalAlignment="Center" Margin="0 16 0 0" |
<StackPanel |
||||
MaxWidth="660"> |
Margin="0,16,0,0" |
||||
<WrapPanel.Styles> |
HorizontalAlignment="Center" |
||||
<Style Selector="ComboBox"> |
Orientation="Horizontal" |
||||
<Setter Property="Width" Value="250" /> |
Spacing="8"> |
||||
<Setter Property="Margin" Value="10" /> |
<WrapPanel |
||||
</Style> |
MaxWidth="660" |
||||
</WrapPanel.Styles> |
Margin="0,16,0,0" |
||||
<ComboBox PlaceholderText="Pick an Item"> |
HorizontalAlignment="Center"> |
||||
<ComboBoxItem>Inline Items</ComboBoxItem> |
<WrapPanel.Styles> |
||||
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
<Style Selector="ComboBox"> |
||||
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
<Setter Property="Width" Value="250" /> |
||||
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
<Setter Property="Margin" Value="10" /> |
||||
</ComboBox> |
</Style> |
||||
|
</WrapPanel.Styles> |
||||
|
|
||||
<ComboBox> |
<ComboBox PlaceholderText="Pick an Item" WrapSelection="{Binding WrapSelection}"> |
||||
<ComboBox.Items> |
<ComboBoxItem>Inline Items</ComboBoxItem> |
||||
<col:ArrayList> |
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
||||
<x:Null /> |
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
||||
<sys:String>Hello</sys:String> |
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
||||
<sys:String>World</sys:String> |
</ComboBox> |
||||
</col:ArrayList> |
|
||||
</ComboBox.Items> |
|
||||
<ComboBox.ItemTemplate> |
|
||||
<DataTemplate> |
|
||||
<Panel> |
|
||||
<TextBlock Text="{Binding}" /> |
|
||||
<TextBlock Text="Null object" IsVisible="{Binding Converter={x:Static ObjectConverters.IsNull}}" /> |
|
||||
</Panel> |
|
||||
</DataTemplate> |
|
||||
</ComboBox.ItemTemplate> |
|
||||
</ComboBox> |
|
||||
|
|
||||
<ComboBox SelectedIndex="0"> |
<ComboBox WrapSelection="{Binding WrapSelection}"> |
||||
<ComboBoxItem> |
<ComboBox.Items> |
||||
<Panel> |
<col:ArrayList> |
||||
<Rectangle Fill="{DynamicResource SystemAccentColor}"/> |
<x:Null /> |
||||
<TextBlock Margin="8">Control Items</TextBlock> |
<sys:String>Hello</sys:String> |
||||
</Panel> |
<sys:String>World</sys:String> |
||||
</ComboBoxItem> |
</col:ArrayList> |
||||
<ComboBoxItem> |
</ComboBox.Items> |
||||
<Ellipse Width="50" Height="50" Fill="Yellow"/> |
<ComboBox.ItemTemplate> |
||||
</ComboBoxItem> |
<DataTemplate> |
||||
<ComboBoxItem> |
<Panel> |
||||
<TextBox Text="TextBox"/> |
<TextBlock Text="{Binding}" /> |
||||
</ComboBoxItem> |
<TextBlock IsVisible="{Binding Converter={x:Static ObjectConverters.IsNull}}" Text="Null object" /> |
||||
</ComboBox> |
</Panel> |
||||
|
</DataTemplate> |
||||
|
</ComboBox.ItemTemplate> |
||||
|
</ComboBox> |
||||
|
|
||||
<ComboBox x:Name="fontComboBox" SelectedIndex="0"> |
<ComboBox SelectedIndex="0" WrapSelection="{Binding WrapSelection}"> |
||||
<ComboBox.ItemTemplate> |
<ComboBoxItem> |
||||
<DataTemplate> |
<Panel> |
||||
<TextBlock Text="{Binding Name}" FontFamily="{Binding}" /> |
<Rectangle Fill="{DynamicResource SystemAccentColor}" /> |
||||
</DataTemplate> |
<TextBlock Margin="8">Control Items</TextBlock> |
||||
</ComboBox.ItemTemplate> |
</Panel> |
||||
</ComboBox> |
</ComboBoxItem> |
||||
|
<ComboBoxItem> |
||||
<ComboBox PlaceholderText="Pick an Item"> |
<Ellipse |
||||
<ComboBoxItem>Inline Items</ComboBoxItem> |
Width="50" |
||||
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
Height="50" |
||||
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
Fill="Yellow" /> |
||||
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
</ComboBoxItem> |
||||
<DataValidationErrors.Error> |
<ComboBoxItem> |
||||
<sys:Exception /> |
<TextBox Text="TextBox" /> |
||||
</DataValidationErrors.Error> |
</ComboBoxItem> |
||||
</ComboBox> |
</ComboBox> |
||||
</WrapPanel> |
|
||||
|
|
||||
</StackPanel> |
<ComboBox |
||||
|
x:Name="fontComboBox" |
||||
|
SelectedIndex="0" |
||||
|
WrapSelection="{Binding WrapSelection}"> |
||||
|
<ComboBox.ItemTemplate> |
||||
|
<DataTemplate> |
||||
|
<TextBlock FontFamily="{Binding}" Text="{Binding Name}" /> |
||||
|
</DataTemplate> |
||||
|
</ComboBox.ItemTemplate> |
||||
|
</ComboBox> |
||||
|
|
||||
|
<ComboBox PlaceholderText="Pick an Item" WrapSelection="{Binding WrapSelection}"> |
||||
|
<ComboBoxItem>Inline Items</ComboBoxItem> |
||||
|
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
||||
|
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
||||
|
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
||||
|
<DataValidationErrors.Error> |
||||
|
<sys:Exception /> |
||||
|
</DataValidationErrors.Error> |
||||
|
</ComboBox> |
||||
|
</WrapPanel> |
||||
|
|
||||
|
<CheckBox IsChecked="{Binding WrapSelection}">WrapSelection</CheckBox> |
||||
|
|
||||
|
</StackPanel> |
||||
|
</StackPanel> |
||||
</UserControl> |
</UserControl> |
||||
|
|||||
@ -0,0 +1,21 @@ |
|||||
|
using System; |
||||
|
using System.Collections.ObjectModel; |
||||
|
using System.Linq; |
||||
|
using System.Reactive; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Controls.Selection; |
||||
|
using MiniMvvm; |
||||
|
|
||||
|
namespace ControlCatalog.ViewModels |
||||
|
{ |
||||
|
public class ComboBoxPageViewModel : ViewModelBase |
||||
|
{ |
||||
|
private bool _wrapSelection; |
||||
|
|
||||
|
public bool WrapSelection |
||||
|
{ |
||||
|
get => _wrapSelection; |
||||
|
set => this.RaiseAndSetIfChanged(ref _wrapSelection, value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
<Application xmlns="https://github.com/avaloniaui" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
x:Class="IntegrationTestApp.App"> |
||||
|
<Application.Styles> |
||||
|
<FluentTheme Mode="Light"/> |
||||
|
</Application.Styles> |
||||
|
</Application> |
||||
@ -0,0 +1,24 @@ |
|||||
|
using Avalonia; |
||||
|
using Avalonia.Controls.ApplicationLifetimes; |
||||
|
using Avalonia.Markup.Xaml; |
||||
|
|
||||
|
namespace IntegrationTestApp |
||||
|
{ |
||||
|
public class App : Application |
||||
|
{ |
||||
|
public override void Initialize() |
||||
|
{ |
||||
|
AvaloniaXamlLoader.Load(this); |
||||
|
} |
||||
|
|
||||
|
public override void OnFrameworkInitializationCompleted() |
||||
|
{ |
||||
|
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) |
||||
|
{ |
||||
|
desktop.MainWindow = new MainWindow(); |
||||
|
} |
||||
|
|
||||
|
base.OnFrameworkInitializationCompleted(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
<PropertyGroup> |
||||
|
<OutputType>WinExe</OutputType> |
||||
|
<TargetFramework>net6.0</TargetFramework> |
||||
|
<Nullable>enable</Nullable> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<CFBundleName>IntegrationTestApp</CFBundleName> |
||||
|
<CFBundleIdentifier>net.avaloniaui.avalonia.integrationtestapp</CFBundleIdentifier> |
||||
|
<NSHighResolutionCapable>true</NSHighResolutionCapable> |
||||
|
<CFBundleShortVersionString>1.0.0</CFBundleShortVersionString> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Dotnet.Bundle" Version="0.9.13" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<Import Project="..\..\build\BuildTargets.targets" /> |
||||
|
<Import Project="..\..\build\SampleApp.props" /> |
||||
|
<Import Project="..\..\build\ReferenceCoreLibraries.props" /> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,95 @@ |
|||||
|
<Window xmlns="https://github.com/avaloniaui" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
||||
|
x:Class="IntegrationTestApp.MainWindow" |
||||
|
Title="IntegrationTestApp"> |
||||
|
<NativeMenu.Menu> |
||||
|
<NativeMenu> |
||||
|
<NativeMenuItem Header="File"> |
||||
|
<NativeMenu> |
||||
|
<NativeMenuItem Header="Open..."/> |
||||
|
</NativeMenu> |
||||
|
</NativeMenuItem> |
||||
|
<NativeMenuItem Header="View"> |
||||
|
<NativeMenu/> |
||||
|
</NativeMenuItem> |
||||
|
</NativeMenu> |
||||
|
</NativeMenu.Menu> |
||||
|
<DockPanel> |
||||
|
<NativeMenuBar DockPanel.Dock="Top"/> |
||||
|
|
||||
|
<TabControl TabStripPlacement="Left" Name="MainTabs"> |
||||
|
<TabItem Header="Automation"> |
||||
|
<StackPanel> |
||||
|
<TextBlock Name="TextBlockWithName">TextBlockWithName</TextBlock> |
||||
|
<TextBlock Name="NotTheAutomationId" AutomationProperties.AutomationId="TextBlockWithNameAndAutomationId"> |
||||
|
TextBlockWithNameAndAutomationId |
||||
|
</TextBlock> |
||||
|
<TextBlock Name="TextBlockAsLabel">Label for TextBox</TextBlock> |
||||
|
<TextBox Name="LabeledByTextBox" AutomationProperties.LabeledBy="{Binding #TextBlockAsLabel}"> |
||||
|
Foo |
||||
|
</TextBox> |
||||
|
</StackPanel> |
||||
|
</TabItem> |
||||
|
|
||||
|
<TabItem Header="Button"> |
||||
|
<StackPanel> |
||||
|
<Button Name="DisabledButton" IsEnabled="False"> |
||||
|
Disabled Button |
||||
|
</Button> |
||||
|
<Button Name="BasicButton"> |
||||
|
Basic Button |
||||
|
</Button> |
||||
|
<Button Name="ButtonWithTextBlock"> |
||||
|
<TextBlock>Button with TextBlock</TextBlock> |
||||
|
</Button> |
||||
|
<Button Name="ButtonWithAcceleratorKey" HotKey="Ctrl+B">Button with Accelerator Key</Button> |
||||
|
</StackPanel> |
||||
|
</TabItem> |
||||
|
|
||||
|
<TabItem Header="CheckBox"> |
||||
|
<StackPanel> |
||||
|
<CheckBox Name="UncheckedCheckBox">Unchecked</CheckBox> |
||||
|
<CheckBox Name="CheckedCheckBox" IsChecked="True">Checked</CheckBox> |
||||
|
<CheckBox Name="ThreeStateCheckBox" IsThreeState="True" IsChecked="{x:Null}">ThreeState</CheckBox> |
||||
|
</StackPanel> |
||||
|
</TabItem> |
||||
|
|
||||
|
<TabItem Header="ComboBox"> |
||||
|
<StackPanel> |
||||
|
<ComboBox Name="BasicComboBox"> |
||||
|
<ComboBoxItem>Item 0</ComboBoxItem> |
||||
|
<ComboBoxItem>Item 1</ComboBoxItem> |
||||
|
</ComboBox> |
||||
|
<Button Name="ComboBoxSelectionClear">Clear Selection</Button> |
||||
|
<Button Name="ComboBoxSelectFirst">Select First</Button> |
||||
|
</StackPanel> |
||||
|
</TabItem> |
||||
|
|
||||
|
<TabItem Header="ListBox"> |
||||
|
<DockPanel> |
||||
|
<StackPanel DockPanel.Dock="Bottom"> |
||||
|
<Button Name="ListBoxSelectionClear">Clear Selection</Button> |
||||
|
</StackPanel> |
||||
|
<ListBox Name="BasicListBox" Items="{Binding ListBoxItems}" SelectionMode="Multiple"/> |
||||
|
</DockPanel> |
||||
|
</TabItem> |
||||
|
|
||||
|
<TabItem Header="Menu"> |
||||
|
<DockPanel> |
||||
|
<Menu DockPanel.Dock="Top"> |
||||
|
<MenuItem Name="RootMenuItem" Header="_Root"> |
||||
|
<MenuItem Name="Child1MenuItem" Header="_Child 1" InputGesture="Ctrl+O" Click="MenuClicked"/> |
||||
|
<MenuItem Name="Child2MenuItem" Header="_Child 1"> |
||||
|
<MenuItem Name="GrandchildMenuItem" Header="_Grandchild" Click="MenuClicked"/> |
||||
|
</MenuItem> |
||||
|
</MenuItem> |
||||
|
</Menu> |
||||
|
<TextBlock Name="ClickedMenuItem">None</TextBlock> |
||||
|
</DockPanel> |
||||
|
</TabItem> |
||||
|
</TabControl> |
||||
|
</DockPanel> |
||||
|
</Window> |
||||
@ -0,0 +1,67 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using Avalonia; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Interactivity; |
||||
|
using Avalonia.Markup.Xaml; |
||||
|
|
||||
|
namespace IntegrationTestApp |
||||
|
{ |
||||
|
public class MainWindow : Window |
||||
|
{ |
||||
|
public MainWindow() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
InitializeViewMenu(); |
||||
|
this.AttachDevTools(); |
||||
|
AddHandler(Button.ClickEvent, OnButtonClick); |
||||
|
ListBoxItems = Enumerable.Range(0, 100).Select(x => "Item " + x).ToList(); |
||||
|
DataContext = this; |
||||
|
} |
||||
|
|
||||
|
public List<string> ListBoxItems { get; } |
||||
|
|
||||
|
private void InitializeComponent() |
||||
|
{ |
||||
|
AvaloniaXamlLoader.Load(this); |
||||
|
} |
||||
|
|
||||
|
private void InitializeViewMenu() |
||||
|
{ |
||||
|
var mainTabs = this.FindControl<TabControl>("MainTabs"); |
||||
|
var viewMenu = (NativeMenuItem)NativeMenu.GetMenu(this).Items[1]; |
||||
|
|
||||
|
foreach (TabItem tabItem in mainTabs.Items) |
||||
|
{ |
||||
|
var menuItem = new NativeMenuItem |
||||
|
{ |
||||
|
Header = (string)tabItem.Header!, |
||||
|
IsChecked = tabItem.IsSelected, |
||||
|
ToggleType = NativeMenuItemToggleType.Radio, |
||||
|
}; |
||||
|
|
||||
|
menuItem.Click += (s, e) => tabItem.IsSelected = true; |
||||
|
viewMenu.Menu.Items.Add(menuItem); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void MenuClicked(object? sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
var clickedMenuItemTextBlock = this.FindControl<TextBlock>("ClickedMenuItem"); |
||||
|
clickedMenuItemTextBlock.Text = ((MenuItem)sender!).Header.ToString(); |
||||
|
} |
||||
|
|
||||
|
private void OnButtonClick(object? sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
var source = e.Source as Button; |
||||
|
|
||||
|
if (source?.Name == "ComboBoxSelectionClear") |
||||
|
this.FindControl<ComboBox>("BasicComboBox").SelectedIndex = -1; |
||||
|
if (source?.Name == "ComboBoxSelectFirst") |
||||
|
this.FindControl<ComboBox>("BasicComboBox").SelectedIndex = 0; |
||||
|
if (source?.Name == "ListBoxSelectionClear") |
||||
|
this.FindControl<ListBox>("BasicListBox").SelectedIndex = -1; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
using System; |
||||
|
using Avalonia; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Controls.ApplicationLifetimes; |
||||
|
|
||||
|
namespace IntegrationTestApp |
||||
|
{ |
||||
|
class Program |
||||
|
{ |
||||
|
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
|
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
|
// yet and stuff might break.
|
||||
|
public static void Main(string[] args) => BuildAvaloniaApp() |
||||
|
.StartWithClassicDesktopLifetime(args); |
||||
|
|
||||
|
// Avalonia configuration, don't remove; also used by visual designer.
|
||||
|
public static AppBuilder BuildAvaloniaApp() |
||||
|
=> AppBuilder.Configure<App>() |
||||
|
.UsePlatformDetect() |
||||
|
.LogToTrace(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,5 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
cd $(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) |
||||
|
dotnet restore -r osx-arm64 |
||||
|
dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-arm64 -p:_AvaloniaUseExternalMSBuild=false |
||||
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
|
||||
|
<!-- |
||||
|
To use the Avalonia CI feed to get unstable packages, move this file to the root of your solution. |
||||
|
--> |
||||
|
|
||||
|
<configuration> |
||||
|
<packageSources> |
||||
|
<add key="AvaloniaCI" value="https://www.myget.org/F/avalonia-ci/api/v2" /> |
||||
|
</packageSources> |
||||
|
</configuration> |
||||
@ -1,35 +1,18 @@ |
|||||
using System; |
|
||||
using System.Reactive.Linq; |
|
||||
using Avalonia; |
|
||||
using Avalonia.Animation; |
|
||||
using Avalonia.Controls; |
using Avalonia.Controls; |
||||
using Avalonia.Data; |
|
||||
using Avalonia.Markup.Xaml; |
using Avalonia.Markup.Xaml; |
||||
using Avalonia.Media; |
|
||||
|
|
||||
namespace RenderDemo.Pages |
namespace RenderDemo.Pages |
||||
{ |
{ |
||||
public class ClippingPage : UserControl |
public class ClippingPage : UserControl |
||||
{ |
{ |
||||
private Geometry _clip; |
|
||||
|
|
||||
public ClippingPage() |
public ClippingPage() |
||||
{ |
{ |
||||
InitializeComponent(); |
InitializeComponent(); |
||||
WireUpCheckbox(); |
|
||||
} |
} |
||||
|
|
||||
private void InitializeComponent() |
private void InitializeComponent() |
||||
{ |
{ |
||||
AvaloniaXamlLoader.Load(this); |
AvaloniaXamlLoader.Load(this); |
||||
} |
} |
||||
|
|
||||
private void WireUpCheckbox() |
|
||||
{ |
|
||||
var useMask = this.FindControl<CheckBox>("useMask"); |
|
||||
var clipped = this.FindControl<Border>("clipped"); |
|
||||
_clip = clipped.Clip; |
|
||||
useMask.Click += (s, e) => clipped.Clip = clipped.Clip == null ? _clip : null; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,7 @@ |
|||||
|
<UserControl xmlns="https://github.com/avaloniaui" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
||||
|
x:Class="RenderDemo.Pages.FormattedTextPage"> |
||||
|
</UserControl> |
||||
@ -0,0 +1,60 @@ |
|||||
|
using System.Globalization; |
||||
|
using Avalonia; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Markup.Xaml; |
||||
|
using Avalonia.Media; |
||||
|
|
||||
|
namespace RenderDemo.Pages |
||||
|
{ |
||||
|
public class FormattedTextPage : UserControl |
||||
|
{ |
||||
|
public FormattedTextPage() |
||||
|
{ |
||||
|
this.InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private void InitializeComponent() |
||||
|
{ |
||||
|
AvaloniaXamlLoader.Load(this); |
||||
|
} |
||||
|
|
||||
|
public override void Render(DrawingContext context) |
||||
|
{ |
||||
|
const string testString = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"; |
||||
|
|
||||
|
// Create the initial formatted text string.
|
||||
|
var formattedText = new FormattedText( |
||||
|
testString, |
||||
|
CultureInfo.GetCultureInfo("en-us"), |
||||
|
FlowDirection.LeftToRight, |
||||
|
new Typeface("Verdana"), |
||||
|
32, |
||||
|
Brushes.Black) { MaxTextWidth = 300, MaxTextHeight = 240 }; |
||||
|
|
||||
|
// Set a maximum width and height. If the text overflows these values, an ellipsis "..." appears.
|
||||
|
|
||||
|
// Use a larger font size beginning at the first (zero-based) character and continuing for 5 characters.
|
||||
|
// The font size is calculated in terms of points -- not as device-independent pixels.
|
||||
|
formattedText.SetFontSize(36 * (96.0 / 72.0), 0, 5); |
||||
|
|
||||
|
// Use a Bold font weight beginning at the 6th character and continuing for 11 characters.
|
||||
|
formattedText.SetFontWeight(FontWeight.Bold, 6, 11); |
||||
|
|
||||
|
var gradient = new LinearGradientBrush |
||||
|
{ |
||||
|
GradientStops = |
||||
|
new GradientStops { new GradientStop(Colors.Orange, 0), new GradientStop(Colors.Teal, 1) }, |
||||
|
StartPoint = new RelativePoint(0,0, RelativeUnit.Relative), |
||||
|
EndPoint = new RelativePoint(0,1, RelativeUnit.Relative) |
||||
|
}; |
||||
|
|
||||
|
// Use a linear gradient brush beginning at the 6th character and continuing for 11 characters.
|
||||
|
formattedText.SetForegroundBrush(gradient, 6, 11); |
||||
|
|
||||
|
// Use an Italic font style beginning at the 28th character and continuing for 28 characters.
|
||||
|
formattedText.SetFontStyle(FontStyle.Italic, 28, 28); |
||||
|
|
||||
|
context.DrawText(formattedText, new Point(10, 0)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,14 +0,0 @@ |
|||||
using Avalonia.Controls; |
|
||||
using Avalonia.Shared.PlatformSupport; |
|
||||
|
|
||||
namespace Avalonia |
|
||||
{ |
|
||||
public sealed class AppBuilder : AppBuilderBase<AppBuilder> |
|
||||
{ |
|
||||
public AppBuilder() : base(new StandardRuntimePlatform(), |
|
||||
builder => StandardRuntimePlatformServices.Register(builder.Instance?.GetType()?.Assembly)) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,13 +1,19 @@ |
|||||
<Project Sdk="MSBuild.Sdk.Extras"> |
<Project Sdk="Xamarin.Legacy.Sdk"> |
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<TargetFramework>monoandroid11.0</TargetFramework> |
<TargetFrameworks>net6.0-android</TargetFrameworks> |
||||
|
<TargetFrameworks Condition="'$(MSBuildRuntimeType)' != 'Core'">$(TargetFrameworks);monoandroid11.0</TargetFrameworks> |
||||
|
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> |
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||
|
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver> |
||||
|
<DebugType>portable</DebugType> |
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\packages\Avalonia\Avalonia.csproj" /> |
<ProjectReference Include="..\..\..\packages\Avalonia\Avalonia.csproj" /> |
||||
|
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.3" /> |
||||
|
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.3.1.3" /> |
||||
|
</ItemGroup> |
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\Avalonia.Base\Avalonia.Base.csproj" /> |
||||
<ProjectReference Include="..\..\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
<ProjectReference Include="..\..\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="..\..\Shared\PlatformSupport\PlatformSupport.projitems" Label="Shared" /> |
|
||||
<Import Project="..\..\..\build\Rx.props" /> |
|
||||
<Import Project="..\..\..\build\AndroidWorkarounds.props" /> |
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,35 +1,82 @@ |
|||||
using Android.App; |
|
||||
using Android.OS; |
using Android.OS; |
||||
using Android.Views; |
using AndroidX.AppCompat.App; |
||||
|
using Android.Content.Res; |
||||
|
using AndroidX.Lifecycle; |
||||
|
using Avalonia.Controls.ApplicationLifetimes; |
||||
|
using Avalonia.Controls; |
||||
|
|
||||
namespace Avalonia.Android |
namespace Avalonia.Android |
||||
{ |
{ |
||||
public abstract class AvaloniaActivity : Activity |
public abstract class AvaloniaActivity<TApp> : AppCompatActivity where TApp : Application, new() |
||||
{ |
{ |
||||
|
internal class SingleViewLifetime : ISingleViewApplicationLifetime |
||||
|
{ |
||||
|
public AvaloniaView View { get; internal set; } |
||||
|
|
||||
|
public Control MainView |
||||
|
{ |
||||
|
get => (Control)View.Content; |
||||
|
set => View.Content = value; |
||||
|
} |
||||
|
} |
||||
|
|
||||
internal AvaloniaView View; |
internal AvaloniaView View; |
||||
object _content; |
internal AvaloniaViewModel _viewModel; |
||||
|
|
||||
|
protected virtual AppBuilder CustomizeAppBuilder(AppBuilder builder) => builder.UseAndroid(); |
||||
|
|
||||
protected override void OnCreate(Bundle savedInstanceState) |
protected override void OnCreate(Bundle savedInstanceState) |
||||
{ |
{ |
||||
|
var builder = AppBuilder.Configure<TApp>(); |
||||
|
|
||||
|
CustomizeAppBuilder(builder); |
||||
|
|
||||
View = new AvaloniaView(this); |
View = new AvaloniaView(this); |
||||
if (_content != null) |
|
||||
View.Content = _content; |
|
||||
SetContentView(View); |
SetContentView(View); |
||||
|
|
||||
|
var lifetime = new SingleViewLifetime(); |
||||
|
lifetime.View = View; |
||||
|
|
||||
|
builder.AfterSetup(x => |
||||
|
{ |
||||
|
_viewModel = new ViewModelProvider(this).Get(Java.Lang.Class.FromType(typeof(AvaloniaViewModel))) as AvaloniaViewModel; |
||||
|
|
||||
|
if (_viewModel.Content != null) |
||||
|
{ |
||||
|
View.Content = _viewModel.Content; |
||||
|
} |
||||
|
|
||||
|
View.Prepare(); |
||||
|
}); |
||||
|
|
||||
|
builder.SetupWithLifetime(lifetime); |
||||
|
|
||||
base.OnCreate(savedInstanceState); |
base.OnCreate(savedInstanceState); |
||||
} |
} |
||||
|
|
||||
public object Content |
public object Content |
||||
{ |
{ |
||||
get |
get |
||||
{ |
{ |
||||
return _content; |
return _viewModel.Content; |
||||
} |
} |
||||
set |
set |
||||
{ |
{ |
||||
_content = value; |
_viewModel.Content = value; |
||||
if (View != null) |
if (View != null) |
||||
View.Content = value; |
View.Content = value; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
|
public override void OnConfigurationChanged(Configuration newConfig) |
||||
|
{ |
||||
|
base.OnConfigurationChanged(newConfig); |
||||
|
} |
||||
|
|
||||
|
protected override void OnDestroy() |
||||
|
{ |
||||
|
View.Content = null; |
||||
|
|
||||
|
base.OnDestroy(); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,11 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Avalonia.Android |
||||
|
{ |
||||
|
internal class AvaloniaViewModel : AndroidX.Lifecycle.ViewModel |
||||
|
{ |
||||
|
public object Content { get; set; } |
||||
|
} |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue