Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Secret Value found!
on:
push:
public:
jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install the gitleaks
run: wget https://github.com/zricethezav/gitleaks/releases/download/v8.15.2/gitleaks_8.15.2_linux_x64.tar.gz
shell: pwsh
- name: Extract the tar file
run: tar xzvf gitleaks_8.15.2_linux_x64.tar.gz
- name: Generate the report
id: gitleaks
run: $GITHUB_WORKSPACE/gitleaks detect -s $GITHUB_WORKSPACE -f json -r $GITHUB_WORKSPACE/leaksreport.json
shell: bash
continue-on-error: true
- name: Setup NuGet.exe
if: steps.gitleaks.outcome != 'success'
uses: nuget/setup-nuget@v1
with:
nuget-version: latest
- name: Install the dotnet
if: steps.gitleaks.outcome != 'success'
uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.x'
- name: Install the report tool packages
if: steps.gitleaks.outcome != 'success'
run: |
nuget install "Syncfusion.Email" -source "https://nexus.syncfusion.com/repository/nuget-hosted/"
dir $GITHUB_WORKSPACE/Syncfusion.Email.1.0.0/lib/netcoreapp3.1
dotnet $GITHUB_WORKSPACE/Syncfusion.Email.1.0.0/lib/netcoreapp3.1/Email.dll "[email protected]" "$GITHUB_REF_NAME" ${{ secrets.NETWORKCREDENTIALS }} ${{ secrets.NETWORKKEY }} "$GITHUB_WORKSPACE"
exit 1
74 changes: 72 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,72 @@
# command-binding-schedule-xamarin
How to bind Schedule commands in Xamarin.Forms (SfSchedule)
# How to bind Schedule commands in Xamarin.Forms (SfSchedule)

You can bind the ViewModel commands to [CellDoubleTappedCommand](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfSchedule.XForms.SfSchedule.html#Syncfusion_SfSchedule_XForms_SfSchedule_CellDoubleTappedCommand) and [VisibleDatesChangedCommand](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfSchedule.XForms.SfSchedule.html#Syncfusion_SfSchedule_XForms_SfSchedule_VisibleDatesChangedCommand) of [SfSchedule](https://www.syncfusion.com/xamarin-ui-controls/xamarin-scheduler) in Xamarin.Forms.

`STEP 1:` Create a ViewModel class and define a `VisibleDatesChangedCommand` and `CellDoubleTappedCommand`.
```
public class SchedulerViewModel : INotifyPropertyChanged
{

        public SchedulerViewModel()
        {
            this.VisibleDatesChangedCommand = new Command<VisibleDatesChangedEventArgs>(OnVisibleDatesChanged);
            this.CellDoubleTappedCommand = new Command<CellTappedEventArgs>(OnCellDoubleTapped);
        }

        /// <summary>
        /// Cell Double Tapped event
        /// </summary>
        /// <param name="obj"></param>
        private void OnCellDoubleTapped(CellTappedEventArgs obj)
        {
            App.Current.MainPage.DisplayAlert("CellDoubleTapped", "Event Triggered", "ok");
        }

        /// <summary>
        /// Visible Dates changed Event
        /// </summary>
        /// <param name="obj"></param>
        private void OnVisibleDatesChanged(VisibleDatesChangedEventArgs obj)
        {
            App.Current.MainPage.DisplayAlert("VisibleDateChanged", "Event Triggered", "ok");

        }

        /// <summary>
        /// Visible Dates changed Command.
        /// </summary>
        public ICommand VisibleDatesChangedCommand { get; set; }

        /// <summary>
        /// CellDoubleTapped command.
        /// </summary>
        public ICommand CellDoubleTappedCommand { get; set; }

        /// <summary>
        /// Occurs when property changed.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Invoke method when property changed.
        /// </summary>
        /// <param name="propertyName">property name</param>
        private void RaiseOnPropertyChanged(string propertyName)
        {
            this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
}
```
`STEP 2:` Bind the VisibleDatesChangedCommand and CellDoubleTappedCommand of ViewModel to the CellDoubleTappedCommand and VisibleDatesChangedCommand in SfSchedule.
```
<schedule:SfSchedule x:Name="Schedule"
                                VisibleDatesChangedCommand="{Binding VisibleDatesChangedCommand}"
                                CellDoubleTappedCommand="{Binding CellDoubleTappedCommand}"
                                ScheduleView="MonthView">
            <schedule:SfSchedule.BindingContext>
                <local:SchedulerViewModel/>
            </schedule:SfSchedule.BindingContext>
</schedule:SfSchedule>
```

KB article - [How to bind Schedule commands in Xamarin.Forms (SfSchedule)](https://www.syncfusion.com/kb/11817/how-to-bind-schedule-commands-in-xamarin-forms-sfschedule)