Skip to content

Commit

Permalink
Fixing code formatting issues in Lombiq.UIKit.Widgets.
Browse files Browse the repository at this point in the history
  • Loading branch information
milosh-96 committed Dec 21, 2024
1 parent 08dfa9e commit 3bdaf05
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,31 @@
namespace Lombiq.UIKit.Widgets.Settings;
public class CarouselWidgetPartSettingsDisplayDriver : ContentTypePartDefinitionDisplayDriver<CarouselWidgetPart>
{
public override IDisplayResult Edit(ContentTypePartDefinition contentTypePartDefinition, BuildEditorContext context) =>
Initialize<CarouselWidgetPartSettingsViewModel>("CarouselWidgetPartSettings_Edit", model =>
public override IDisplayResult Edit(ContentTypePartDefinition model, BuildEditorContext context) =>
Initialize<CarouselWidgetPartSettingsViewModel>("CarouselWidgetPartSettings_Edit", viewModel =>
{
var settings = contentTypePartDefinition.GetSettings<CarouselWidgetPartSettings>();
var settings = model.GetSettings<CarouselWidgetPartSettings>();

model.Options = settings.Options;
viewModel.Options = settings.Options;
}).Location("Content");

public override async Task<IDisplayResult> UpdateAsync(ContentTypePartDefinition contentTypePartDefinition, UpdateTypePartEditorContext context)
public override async Task<IDisplayResult> UpdateAsync(ContentTypePartDefinition model, UpdateTypePartEditorContext context)
{
var model = new CarouselWidgetPartSettingsViewModel();
var viewModel = new CarouselWidgetPartSettingsViewModel();

await context.Updater.TryUpdateModelAsync(
model,
viewModel,
Prefix,
m => m.Options
);

var settings = new CarouselWidgetPartSettings
{
Options = model.Options ?? DefaultValues.CarouselWidgetPartOptions,
Options = viewModel.Options ?? DefaultValues.CarouselWidgetPartOptions,
};

context.Builder.WithSettings(settings);

return await EditAsync(contentTypePartDefinition, context);
return await EditAsync(model, context);
}

}

0 comments on commit 3bdaf05

Please sign in to comment.