-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Theme:: Perbaikan tampilan dan responsibilitas
- Loading branch information
1 parent
fcdadab
commit 96a1f29
Showing
22 changed files
with
143 additions
and
136 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
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
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
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
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 |
---|---|---|
@@ -1,11 +1,51 @@ | ||
using IhandCashier.Bepe.Types; | ||
using IhandCashier.Core.Maui.Providers; | ||
|
||
namespace IhandCashier.Pages.Views; | ||
|
||
public class BaseView : ContentView | ||
{ | ||
private static EventHandler _RefreshlickedHandlerRef; | ||
private static EventHandler _EditClickedHandlerRef; | ||
private static EventHandler _DeleteClickedHandlerRef; | ||
|
||
public static MenuFlyoutItem RefreshMenu = new() { Text = "Refresh Data"}; | ||
public static MenuFlyoutItem EditMenu = new() { Text = "Ubah Data"}; | ||
public static MenuFlyoutItem DeleteMenu = new() { Text = "Hapus Data"}; | ||
public void ResetView() | ||
{ | ||
DatagridProvider.Reset(); | ||
DatagridProvider.DataGrid.BindingContext = null; | ||
} | ||
|
||
public void SetContextMenuHandler(MenuFlyout ContextMenu, ContextMenuHandlers handler) | ||
{ | ||
if (_RefreshlickedHandlerRef != null)RefreshMenu.Clicked -= _RefreshlickedHandlerRef; | ||
if (_EditClickedHandlerRef != null) EditMenu.Clicked -= _EditClickedHandlerRef; | ||
if (_DeleteClickedHandlerRef != null) DeleteMenu.Clicked -= _DeleteClickedHandlerRef; | ||
|
||
if(handler.RefreshHandler != null) ContextMenu.Add(RefreshMenu); | ||
if(handler.EditHandler != null) ContextMenu.Add(EditMenu); | ||
if (handler.DeleteHandler != null) | ||
{ | ||
ContextMenu.Add(new MenuFlyoutSeparator()); | ||
ContextMenu.Add(DeleteMenu); | ||
} | ||
|
||
|
||
_RefreshlickedHandlerRef = handler.RefreshHandler; | ||
_EditClickedHandlerRef = handler.EditHandler; | ||
_DeleteClickedHandlerRef = handler.DeleteHandler; | ||
|
||
RefreshMenu.Clicked += _RefreshlickedHandlerRef; | ||
EditMenu.Clicked += _EditClickedHandlerRef; | ||
DeleteMenu.Clicked += _DeleteClickedHandlerRef; | ||
} | ||
} | ||
|
||
public class ContextMenuHandlers | ||
{ | ||
public EventHandler? RefreshHandler { get; set; } | ||
public EventHandler? EditHandler { get; set; } | ||
public EventHandler? DeleteHandler { get; set; } | ||
} |
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.