ButchersBoy / Dragablz

Dragable and tearable tab control for WPF
http://dragablz.net
MIT License
2.17k stars 321 forks source link

Savablz 🎉 #210

Open jeremyVignelles opened 6 years ago

jeremyVignelles commented 6 years ago

Background

This is the first implementation of what I call "Savablz", layout windows that can be saved. I think this is a required feature for many of us : #201, someone on gitter asked, this, I needed this, and you also had to do that too in doobry.

I'm pretty new to the project so I admit I've no idea if I cover all the cases.

Implementation

I've read what you did in https://github.com/ButchersBoy/doobry/blob/master/Doobry/MainWindowViewModel.cs , but this implementation:

Note: this PR is based on top of #207, feel free to cherry pick if you don't want that.

I also implemented a new Sample project that demonstrates how that works.

How it works

About the new sample project

This sample is aimed at providing a simple getting started for the common scenario. It is not meant to provide a full documentation. It is however a good way to get started.

Tabs are just showing a GUID in the header and in the content. The view model is very simple, and so is the Model, but it is here to demonstrate how things work together. When the "main" window is closed, the state is saved and is restored at next startup, thanks to the .net's Settings mechanism.

When the last tab of the main window is closed, the settings are reset and a fresh configuration is generated on the next startup.

Questions

jeremyVignelles commented 6 years ago

It looks like I'm using new features of C# that are not available on appveyor? Would you like me to fix that, or do you want to update your appveyor to vs2017 ?

jeremyVignelles commented 6 years ago

Hi, I removed the code that used the newest C# syntax features (last 2 commits) to make appveyor happy and to make it generate the NuGet packages correctly. @ButchersBoy Is it possible to review it ? I really need this feature and I'm sure I'm not the only one.

Viktor9212 commented 5 years ago

How do i DownLoad your commits?

jeremyVignelles commented 5 years ago

You can use the .nupkg from here https://ci.appveyor.com/project/ButchersBoy/dragablz/build/0.0.3.210/artifacts

zenchanhk commented 5 years ago

Hi, Where can I found the sample project? Thanks.

zenchanhk commented 5 years ago

I found on your github, thanks.

zenchanhk commented 5 years ago

@jeremyVignelles I found a bug when running your demo. There is a ghost shadow coming with the window, when it got maximized and reopened after closing the maximized window. ScreenShot

jeremyVignelles commented 5 years ago

@zenchanhk : sorry for the delay. I don't know where that ghost comes from, but I don't see how it could be caused by this PR. Do you have a repo when I can try to reproduce your issue?

speedyalibaba commented 5 years ago

@jeremyVignelles Hi, I downloaded your sample and I have a question. Woh would you implement your solution if you had different views/viewModels in each tab?

jeremyVignelles commented 5 years ago

I'd have one TabContentModel that might be defined with a Kind property and a Model property? The corresponding TabContentView would choose the view to display based on the Kind property or something.

I didn't test it tough, just an idea.

jeremyVignelles commented 5 years ago

Another way I can think of is to make all your model implement the same ITabModel interface, and play with the Newtonsoft.Json's serialization options

speedyalibaba commented 5 years ago

I'd have one TabContentModel that might be defined with a Kind property and a Model property? The corresponding TabContentView would choose the view to display based on the Kind property or something.

I didn't test it tough, just an idea.

Thanks a lot :) Hopefully this PR will be reviewed soon.

jeremyVignelles commented 5 years ago

Hopefully this PR will be reviewed soon. I wouldn't count on it. It's been around for a while and there have been no commit in a year.

I guess the author, like many other open source devs have no more time to maintain it or has lost interest in maintaining it. I could try to fork it myself, but my time is also very limited due to maintaining Vlc.DotNet...

EDIT: His status reads "Taking a break from open source."...