-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb3e696
commit 8710dc8
Showing
23 changed files
with
347 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace Gallery.Samples | ||
|
||
open Gallery | ||
open Fabulous.Maui | ||
open Microsoft.Maui | ||
open Microsoft.Maui.Graphics | ||
open type Fabulous.Maui.View | ||
|
||
module ImageButton = | ||
let view () = | ||
VStack(spacing = 15.) { | ||
Label("Default ImageButton") | ||
ImageButton("dotnet_bot.png", ()) | ||
|
||
Label("ImageButton with background and width/height") | ||
|
||
ImageButton("dotnet_bot.png", ()) | ||
.background(SolidPaint(Colors.LightBlue)) | ||
.width(250.) | ||
.height(50.) | ||
|
||
Label("ImageButton with Aspect = Fill") | ||
ImageButton("dotnet_bot.png", ()).aspect(Aspect.Fill) | ||
} | ||
|
||
let sampleProgram = Helper.createStatelessProgram view | ||
|
||
let sample = | ||
{ Name = "ImageButton" | ||
Description = "A button widget with an image that reacts to touch events" | ||
Program = sampleProgram } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Microsoft.Maui; | ||
using Microsoft.Maui.Handlers.Defaults; | ||
|
||
namespace Fabulous.Maui | ||
{ | ||
public interface IFabImageButton: IImageButton, IFabButton, IFabImage | ||
{ | ||
|
||
} | ||
} | ||
|
||
namespace Fabulous.Maui.Controls | ||
{ | ||
public class FabImageButton : FabButton, IFabImageButton | ||
{ | ||
private bool _isLoading; // TODO: What is this for? | ||
|
||
public void UpdateIsLoading(bool isLoading) | ||
{ | ||
_isLoading = isLoading; | ||
} | ||
|
||
public IImageSource? Source { get; private set; } = ImageSourcePartDefaults.Source; | ||
public bool IsAnimationPlaying { get; private set; } = ImageDefaults.IsAnimationPlaying; | ||
public Aspect Aspect { get; private set; } = ImageDefaults.Aspect; | ||
public bool IsOpaque { get; private set; } = ImageDefaults.IsOpaque; | ||
|
||
public void SetSource(IImageSource? value) => Source = value; | ||
public void SetIsAnimationPlaying(bool value) => IsAnimationPlaying = value; | ||
public void SetAspect(Aspect value) => Aspect = value; | ||
public void SetIsOpaque(bool value) => IsOpaque = value; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.