Page Index Toggle Pages: 1 [2]  Send TopicPrint
Very Hot Topic (More than 25 Replies) ItemClick does't works! (Read 2062 times)
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #15 - Sep 7th, 2023 at 9:56am
Print Post  
Quote:
2)The Appointment Form save or delete clicked.


form's DialogResult is set to true for Save, and null for delete.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: ItemClick does't works!
Reply #16 - Sep 8th, 2023 at 7:31am
Print Post  
Hi Slavcho,

Here is a test project.

1)The Button Foreground not changed.
2)The Appointment Form's DialogResult will retrun 'False' when click delete button or close window. How to detect the item has been deleted ?
3)How to save the Appointment as a JsonObject or an XML document ?
4)The DescriptionText can't type Enter or Shift+Enter.
I want input text like this :
123
456
789
5)The alarm clock doesn't seem to work. I have set a 10-minute reminder, but I didn't receive any reminder when the time was up.

  

Scheduling_ICalendarFormat.zip ( 117 KB | 159 Downloads )
5.png ( 35 KB | 22 Downloads )
5.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #17 - Sep 8th, 2023 at 9:13am
Print Post  
Quote:
The alarm clock doesn't seem to work. I have set a 10-minute reminder, but I didn't receive any reminder when the time was up.


Set calendar.DisableReminders = false, and handle Schedule.ItemReminderTriggered event to get notified. The component does not display any reminder messages out of the box, you'd need to alert the user in whatever way suits your app's UI.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #18 - Sep 8th, 2023 at 9:40am
Print Post  
Quote:
type Enter or Shift+Enter


Set AcceptsReturn like this for time being; we'll enable it by default for next release:

Quote:
var form = new AppointmentForm(...);
var panel = (Panel)form.Content;
var descBox = (TextBox)panel.FindName("_tbContents");
descBox.AcceptsReturn = true;


Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #19 - Sep 8th, 2023 at 10:54am
Print Post  
Quote:
3)How to save the Appointment as a JsonObject or an XML document ?


Only Schedule has direct methods for saving or loading. There's public classes letting you save individual objects too -

Code
Select All
var json = new MindFusion.Json.Wpf.JsonObject();
app.SaveTo(json, context);
var serializer = new MindFusion.Json.Wpf.Serializer();
var jsonString = context.Serialize(json);
Debug.WriteLine(jsonString);

var parser = new MindFusion.Json.Wpf.Parser();
json = parser.ReadJsonObject(jsonString, context);
app.LoadFrom(json, context); 



but that might not be enough if you have related objects like contacts or resources associated with the appointment.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #20 - Sep 8th, 2023 at 11:00am
Print Post  
Quote:
DialogResult will return 'False'


Apparently WPF doesn't let us close dialog with a null result and we copied the null value from our WinForms scheduler too blindly. We'll have to add a separate property for that. For time being you can check if appointment is still in schedule -

Code
Select All
if (!calendar.Schedule.Items.Contains(app)) 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #21 - Sep 11th, 2023 at 7:14am
Print Post  
Quote:
The Button Foreground not changed.


The material design theme seems too invasive. You can override it for these buttons by explicitly setting Style to null, so it value is no longer unset and it stops inheriting from theme -

Code
Select All
foreach (Button button in toolbar.Items)
{
	button.Foreground = Brushes.Orange;
	button.Style = null;
} 



We'll check if we can integrate better with the theme for next release.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #22 - Sep 11th, 2023 at 7:19am
Print Post  
You might try setting Style = null for the whole dialog, it could help for the missing up-down arrows too, but will also remove other material-design stylings.
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: ItemClick does't works!
Reply #23 - Sep 21st, 2023 at 8:38am
Print Post  
Hi Slavcho,

1)How to check the recurrence appointment is expired ?

2)How to get the last item's EndDate in the recurrence appointment ?

3) I have an recurrence appointment 9/7、9/14、9/21 and i delete the first item (9/7).
How to get the appointment's starttime and endtime when i moving the item (9/14) to 9/22 ? The starttime and endtime should be 9/14 and 9/21.


Thank you.
« Last Edit: Sep 21st, 2023 at 10:58am by Mandy »  

2023-09-21_171814.png ( 41 KB | 19 Downloads )
2023-09-21_171814.png
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: ItemClick does't works!
Reply #24 - Sep 21st, 2023 at 12:11pm
Print Post  
Hi Slavcho,


HOW to set the _calendar cell  FontWeight = Bold ?
  

Scheduling_DualView.zip ( 433 KB | 140 Downloads )
2023-09-21_200730.png ( 56 KB | 18 Downloads )
2023-09-21_200730.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #25 - Sep 22nd, 2023 at 8:24am
Print Post  
Quote:
How to check the recurrence appointment is expired ?
How to get the last item's EndDate in the recurrence appointment ?


You could check Recurrence.GetEndDate result. For recurrences set to happen a number of times, it will calculate on which date last one actually starts. If you need to find last end time (e.g. for multiple-day appointments), easiest is to generate the instances and check the EndTime of last element. E.g. try this code:

Code
Select All
var systemCalednar = Thread.CurrentThread.CurrentCulture.Calendar;
var endDate = recurrence.GetEndDate(systemCalednar);
if (endDate == DateTime.MaxValue)
{
	Debug.WriteLine("it never ends");
}
else
{
	// make sure past midnight
	endDate = endDate.AddDays(1);

	var instances = recurrence.GenerateItems(
		recurrence.StartDate, endDate);
	Debug.WriteLine(instances.Last()?.EndTime);
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #26 - Sep 22nd, 2023 at 8:33am
Print Post  
Quote:
How to get the appointment's starttime and endtime when i moving the item (9/14) to 9/22 ? The starttime and endtime should be 9/14 and 9/21.


If you mean detecting when user moves appointment interactively, handle the Calendar.ItemModified event:

Code
Select All
void OnItemModified(object sender, ItemModifiedEventArgs e)
{
	Debug.WriteLine(e.OldStartTime);
	Debug.WriteLine(e.OldEndTime);
} 

  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3157
Joined: Oct 19th, 2005
Re: ItemClick does't works!
Reply #27 - Sep 22nd, 2023 at 9:23am
Print Post  
Quote:
HOW to set the _calendar cell FontWeight = Bold ?


You could modify CellPresenter from CellPresenterCreated event handler.

Code
Select All
void OnCellPresenterCreated(object sender, CellPresenterEventArgs e)
{
    if (e.CellPresenter.StartTime.Date == DateTime.Now.AddDays(1).Date)
    {
        var headerStyle = new CalendarStyle();
        headerStyle.FontWeight = FontWeights.Bold;
        headerStyle.Foreground = Brushes.Red;
        e.CellPresenter.SetValue(
            CellPresenter.CellHeaderStyleProperty, headerStyle);
    }
} 



For more elaborate customizations, check the CustomCellPresenter and its Xaml template in DualView sample project.

Also please post unrelated questions in separate threads, to keep the forum easier for searching Wink

Regards,
Slavcho
Mindfusion
« Last Edit: Sep 22nd, 2023 at 11:10am by Slavcho »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint