C
C#11mo ago
Mekasu0124

✅ Cannot figure out resolve issue

https://github.com/mekasu0124/Diary I have attempted to resolve the issues in my 3 axaml pages. /Views/AddItemView.axaml => Unable to resolve type Diary.Views.AddItemView /Views/DiaryListView.axaml => Unable to resolve type Diary.Views.DiaryListView /Views/EditItemView.axaml => Unabe to resolve type Diary.Views.EditItemView I took a few hours break in between attempting to fix this issue. I have re-written the project to Avalonia 11, and I'm just honestly lost. Thanks in advance.
GitHub
GitHub - mekasu0124/Diary
Contribute to mekasu0124/Diary development by creating an account on GitHub.
31 Replies
SinFluxx
SinFluxx11mo ago
I'm not sure if it's the source of all the issues, but on your DiaryListView you have:
<DataGrid SelectionMode="Extended"
AutoGenerateColumns="False"
Items="{Binding Items}"
<DataGrid SelectionMode="Extended"
AutoGenerateColumns="False"
Items="{Binding Items}"
I believe that should be ItemsSource="{Binding Items}" I changed that and then it ran fine for me
Mekasu0124
Mekasu012411mo ago
beautiful. thank you! I do have another question. I am trying to get the foreground (text color) of the date and time picker to be green, but this styling isn't working. What am I missing please?
Mekasu0124
Mekasu012411mo ago
I'm also trying to get the style to stay the same when hovering over the TextBox's. In the same image above, when you hover over the text box, it stays gray. I need it to stay with a transparent background and green foreground, however, I cannot figure out what to put in the setter property when trying to style <Style Selector="TextBox:pointerover"> any ideas?
SinFluxx
SinFluxx11mo ago
do you mean the text on the actual pop up selector? if so should be that you want to have: <Style Selector=DatePickerPresenter>... To stop the textbox style changing when you hover, do:
<Style Selector="TextBox:pointerover">
<Setter Property="Foreground" Value="#00B71C" />

<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="#00B71C"/>
<Setter Property="Background" Value="Transparent" />
</Style>

<Style Selector="^ /template/ TextBlock#PART_Watermark">
<Setter Property="Foreground" Value="#00B71C" />
</Style>
</Style>
<Style Selector="TextBox:pointerover">
<Setter Property="Foreground" Value="#00B71C" />

<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="#00B71C"/>
<Setter Property="Background" Value="Transparent" />
</Style>

<Style Selector="^ /template/ TextBlock#PART_Watermark">
<Setter Property="Foreground" Value="#00B71C" />
</Style>
</Style>
Which I've simply adapated with your styles, based on how they set the styling in the source, here: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
Mekasu0124
Mekasu012411mo ago
on the popup is great too, but I meant on the display where it shows the selection instead of the popup window
SinFluxx
SinFluxx11mo ago
Where it's got the placeholders "day" "month" "year" ?
Mekasu0124
Mekasu012411mo ago
right so like you select your day, month, and year and click the check mark to close the pop up and it displays that selection
Mekasu0124
Mekasu012411mo ago
when I hover over, that part is fixed, but now when I click to type in the text box and move my mouse away from it, it becomes this
SinFluxx
SinFluxx11mo ago
I guess for that one you'd want to do a Style for TextBox:focus with the same styles again
Mekasu0124
Mekasu012411mo ago
yea I tried that with
<Style Selector="TextBox:focus">
<Setter Property="Background" Value="Black" />
</Style>
<Style Selector="TextBox:focus">
<Setter Property="Background" Value="Black" />
</Style>
and that's not working
SinFluxx
SinFluxx11mo ago
here's the styling for :focus from their source (again updated with your style values):
<Style Selector="TextBox:focus">
<Setter Property="Foreground" Value="#00B71C" />

<Style Selector="^ /template/ TextBlock#PART_Watermark">
<Setter Property="Foreground" Value="#00B71C" />
</Style>

<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="#00B71C"/>
<Setter Property="BorderThickness" Value="1" />
</Style>
</Style>
<Style Selector="TextBox:focus">
<Setter Property="Foreground" Value="#00B71C" />

<Style Selector="^ /template/ TextBlock#PART_Watermark">
<Setter Property="Foreground" Value="#00B71C" />
</Style>

<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="#00B71C"/>
<Setter Property="BorderThickness" Value="1" />
</Style>
</Style>
that seems to work for me once I've selected a date the values already display as green for me
Mekasu0124
Mekasu012411mo ago
so I put that in, and now i can't enter text? lol yes, they display green after selection, but not before selection
SinFluxx
SinFluxx11mo ago
😆 what? I have no idea why that would be... it's working fine for me! Do you want to push your latest code up?
Mekasu0124
Mekasu012411mo ago
lmao that's what I said. Push has been made.
SinFluxx
SinFluxx11mo ago
Mekasu0124
Mekasu012411mo ago
yea so it works fine when I run the application. it's weird. Like putting those changes in have effected the Ok and Cancel buttons at the bottom and now the buttons across the bottom of DiaryListView.axaml's screen have disappeared as well and won't show.....I'm so lost
SinFluxx
SinFluxx11mo ago
I still see the buttons on DiaryListView
Mekasu0124
Mekasu012411mo ago
I'm currently running the application and I do not
SinFluxx
SinFluxx11mo ago
have you made other changes to the styles on that window?
Mekasu0124
Mekasu012411mo ago
no. the only styles that I have touched were on the AddItemView.axaml page. That's it
SinFluxx
SinFluxx11mo ago
No clue why that would have happened then, and I'm running the code you recently pushed to github as well and not seeing the issue! For this one, I can get the foreground to update with:
<Style Selector="DatePicker /template/ Button TextBlock:nth-child(2)">
<Setter Property="Foreground" Value="#00B71C" />
</Style>
<Style Selector="DatePicker /template/ Button TextBlock:nth-child(2)">
<Setter Property="Foreground" Value="#00B71C" />
</Style>
But only one-by-one, e.g. the above does "month", I haven't been able to figure out a selector that gets all 3 textblocks at once I'm afraid
Mekasu0124
Mekasu012411mo ago
this made the month part appear, so I'll have to repeat twice more for the rest I wonder if these buttons are "missing" because they're only enabled if requirements are met. What I mean by that is in order for Edit Entry and Share Entry to work, you have to select an item from the datagrid. I don't think they'll work otherwise, so they appear to be disabled.
SinFluxx
SinFluxx11mo ago
My end they are appearing in a disabled state, I suppose you could follow up with that once you test with some data in there
Mekasu0124
Mekasu012411mo ago
this worked on DatePicker, but applying the same principle to TimePicker didn't work I have tested styling the Button:disabled Selector but it's not working
Mekasu0124
Mekasu012411mo ago
one small nitpick thing I wish I could figure out is how to get these to align center horizontally and be the same width or something, but I've tried everything I can think of. I just hate the way this looks. It's so uneven and tacky lol
Mekasu0124
Mekasu012411mo ago
I was able to get it this far lol but I can't figure out how the width is effected whatsoever or how to get each column to be the same width
Mekasu0124
Mekasu012411mo ago
I figured it out on that part lol now to get the time picker to work correctly
SinFluxx
SinFluxx11mo ago
yeah sorry I've been having a look here and there between things but I've not been able to figure out the TimePicker selectors
Mekasu0124
Mekasu012411mo ago
it's not problem. I should probably redesign the color scheme anyways lol
Mekasu0124
Mekasu012411mo ago
this right here determines my button as being enabled or disabled based off criteria met. How can I style the button so that it has the same appearance whether it's enabled or disabled and only be clickable when this criteria is met?
Mekasu0124
Mekasu012411mo ago
I figured out why the buttons wouldn't work on the home screen. I had bound my functions by the wrong names so it couldn't find what to bind to lol
Want results from more Discord servers?
Add your server
More Posts
✅ How to resolve CS9017 when trying passing captured arguments by primary constructor to base class?I am using C# 12. The base class: ```csharp public class DbExtension(IOptionsMonitor<AppConfig> app❔ System.BadImageFormatException: Cannot load a reference assembly for execution.Hello, I'm trying to debug this exception in my C# app. I've tried solutions from stack overflow -❔ Suppressing ASP0001: AuthorizationMiddleware is incorrectly configuredI am hosting a Blazor server app and a Web API in the same ASP.NET project, and I have set up my rou❔ Spreadsheet option for a dict / class? (visual studio)I finally set a bunch of stuff up and their working correctly, huzah! Now, i have a dictionary that❔ Constant string value for discriminator using SwashbuckleI've spent hours Googling around and testing. I have a simple table-per-hierarchy pattern going on. ❔ Entity Framework 7 model property as enum is giving conflicts when running migrationI'm trying to create a many to many "pivot" model where it haves 2 fields "GroupId" and "Subscriptio❔ Is there a way to make this neater?``` public void AddTags(string tag) { Tags?.Add(tag); Tags = Tags; } ❔ Is it Possible to Consume a Queue Message by Multiple Consumers ( RabbitMQ & MassTransit ) ?Hi friends, I'm working on a project using `Microservices` architecture, I have `AuthService`, `Exp❔ ClicksI know how to make it so that when a user clicks a picturebox it adds 1 'click' to a label, but how ❔ FRUSTRATIONI'm having the worst time trying to figure out why I'm getting a Error while compiling: IslandPatrol