Click here to Skip to main content
15,922,427 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to make a dll library? Pin
OriginalGriff16-Nov-20 5:41
mveOriginalGriff16-Nov-20 5:41 
GeneralRe: How to make a dll library? Pin
OriginalGriff16-Nov-20 2:21
mveOriginalGriff16-Nov-20 2:21 
QuestionC# WPF MenuItem Control not working Pin
Member 783087415-Nov-20 9:01
Member 783087415-Nov-20 9:01 
AnswerRe: C# WPF MenuItem Control not working Pin
Mycroft Holmes15-Nov-20 11:03
professionalMycroft Holmes15-Nov-20 11:03 
GeneralRe: C# WPF MenuItem Control not working Pin
Member 783087417-Nov-20 14:51
Member 783087417-Nov-20 14:51 
QuestionHow to group an array list, within a list of records, Linq GroupBy Pin
jkirkerx14-Nov-20 13:29
professionaljkirkerx14-Nov-20 13:29 
AnswerRe: How to group an array list, within a list of records, Linq GroupBy Pin
Gerry Schmitz14-Nov-20 22:31
mveGerry Schmitz14-Nov-20 22:31 
QuestionA proper way to return a list (Xamarin, CollectionView, Realm) Pin
Member 1499286214-Nov-20 9:10
Member 1499286214-Nov-20 9:10 
Hi!

I try to show dynamically a Xamarin CollectionView (as a visual list of multiple notes), by following this tuto: https://medium.com/a-developer-in-making/how-to-work-with-collectionview-in-xamarin-forms-5dc65c50b419[^]
Everything's work fine, until I try to return a list made of data from a Realm database.

So, that code from the tuto is working fine:
C#
return new List<Note>
                {
                new Note() { Category = listFolders[0].IDCategories, Title = listFolders[0].Title, ContentNote = listFolders[0].ContentNote, Image = listFolders[0].Icon },
                new Note() { Category = listFolders[1].IDCategories, Title = listFolders[1].Title, ContentNote = listFolders[1].ContentNote, Image = listFolders[1].Icon },
                new Note() { Category = listFolders[2].IDCategories, Title = listFolders[2].Title, ContentNote = listFolders[2].ContentNote, Image = listFolders[2].Icon },
                };


And it doesn't work when I try to do the same thing, from a Realm database. Something like that:
(there is no errors, it's just show nothing during the debug).

C#
List<Note> list = new List<Note>();
                for (int i = 0; i < countFolders; i++)
                {
                    new Note() { Category = listFolders[i].IDCategories, Title = listFolders[i].Title, ContentNote = listFolders[i].ContentNote, Image = listFolders[i].Icon };
                }

                return list;


And I tried that too:
C#
return new List<Note>
                {
                    for (int i = 0; i < countFolders; i++)
                {
                    new Note() { Category = listFolders[i].IDCategories, Title = listFolders[i].Title, ContentNote = listFolders[i].ContentNote, Image = listFolders[i].Icon };
                }
              
                }

But just after the first bracket, VS Studio say: " } awaited " and " ; awaited ". But I don't know where precisly... And there is no correction suggested.

I'm sure that's probably simple, but as a beginner, I still miss some things.

Thanks!
SuggestionRe: A proper way to return a list (Xamarin, CollectionView, Realm) Pin
Richard MacCutchan14-Nov-20 6:07
mveRichard MacCutchan14-Nov-20 6:07 
GeneralRe: A proper way to return a list (Xamarin, CollectionView, Realm) Pin
Member 1499286214-Nov-20 9:10
Member 1499286214-Nov-20 9:10 
GeneralRe: A proper way to return a list (Xamarin, CollectionView, Realm) Pin
OriginalGriff14-Nov-20 9:16
mveOriginalGriff14-Nov-20 9:16 
AnswerRe: A proper way to return a list (Xamarin, CollectionView, Realm) Pin
Mycroft Holmes14-Nov-20 12:18
professionalMycroft Holmes14-Nov-20 12:18 
GeneralRe: A proper way to return a list (Xamarin, CollectionView, Realm) Pin
Member 1499286216-Nov-20 8:17
Member 1499286216-Nov-20 8:17 
QuestionHow to selected value of a dropbox column of a DataGridView programmatically? Pin
Alex Dunlop13-Nov-20 0:41
Alex Dunlop13-Nov-20 0:41 
AnswerRe: How to selected value of a dropbox column of a DataGridView programmatically? Pin
Richard MacCutchan13-Nov-20 1:55
mveRichard MacCutchan13-Nov-20 1:55 
GeneralRe: How to selected value of a dropbox column of a DataGridView programmatically? Pin
Richard Deeming13-Nov-20 2:06
mveRichard Deeming13-Nov-20 2:06 
GeneralRe: How to selected value of a dropbox column of a DataGridView programmatically? Pin
Richard MacCutchan13-Nov-20 2:16
mveRichard MacCutchan13-Nov-20 2:16 
GeneralRe: How to selected value of a dropbox column of a DataGridView programmatically? Pin
Alex Dunlop13-Nov-20 3:09
Alex Dunlop13-Nov-20 3:09 
AnswerRe: How to selected value of a dropbox column of a DataGridView programmatically? Pin
Gerry Schmitz13-Nov-20 4:10
mveGerry Schmitz13-Nov-20 4:10 
QuestionCommented code in c# forms does it affect the performance Pin
Sachin Kulkarni B12-Nov-20 4:50
Sachin Kulkarni B12-Nov-20 4:50 
AnswerRe: Commented code in c# forms does it affect the performance Pin
OriginalGriff12-Nov-20 5:08
mveOriginalGriff12-Nov-20 5:08 
GeneralRe: Commented code in c# forms does it affect the performance Pin
trønderen12-Nov-20 7:22
trønderen12-Nov-20 7:22 
AnswerRe: Commented code in c# forms does it affect the performance Pin
Gerry Schmitz13-Nov-20 3:58
mveGerry Schmitz13-Nov-20 3:58 
QuestionThe name does not exist in the current context Pin
darkdxd11-Nov-20 22:04
darkdxd11-Nov-20 22:04 
AnswerRe: The name does not exist in the current context Pin
Richard Deeming11-Nov-20 23:01
mveRichard Deeming11-Nov-20 23:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.