This question is locked. New answers and comments are not allowed.
hi,
I'm having a weird behavior to my messagebox
here is the code
so what my code above do is i trigger that rate_tap from my listbox that already contain image, and each time i tap it , it suppose to check to my windows azure server and check if there is itemid that equal to id then i will show messagebox saying i already rate it and if there isn't any itemid that equal to id then it will execute radmessagebox.
but it's not working that way, when it check there is itemid that equal to id, it show messagebox and after that it show the radmessagebox... it weird... so where the wrong part?
I'm having a weird behavior to my messagebox
here is the code
private
async
void
rate_Tap(
object
sender, System.Windows.Input.GestureEventArgs e)
{
string
id = (
string
)((Image)sender).Tag;
ignoreSelectionChanged =
true
;
MobileServiceCollection<rating, rating> items;
IMobileServiceTable<rating> itemTable = App.MobileService.GetTable<rating>();
items = await itemTable
.Where(Table => Table.userid == userId)
.ToCollectionAsync();
if
(id !=
null
)
{
for
(
int
i = 0; i < items.Count; i++)
{
if
(items[i].itemid == id)
{
MessageBox.Show(
"You already giving your rating."
);
i = items.Count;
return
;
}
else
{
RadMessageBox.Show(
new
string
[] {
"very accurate"
,
"not accurate"
},
"Acurate?"
,
"Is this information accurate?"
, closedHandler: (args) =>
{
int
buttonIndex = args.ButtonIndex;
if
(buttonIndex == 0)
{
clearListBox();
ratingPlus(id);
saveRating(id);
mvm.LoadDetailData();
}
if
(buttonIndex == 1)
{
clearListBox();
ratingMinus(id);
saveRating(id);
mvm.LoadDetailData();
}
});
}
}
}
}
but it's not working that way, when it check there is itemid that equal to id, it show messagebox and after that it show the radmessagebox... it weird... so where the wrong part?